1f08c3bdfSopenharmony_ci/*
2f08c3bdfSopenharmony_ci * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
3f08c3bdfSopenharmony_ci *
4f08c3bdfSopenharmony_ci * This program is free software; you can redistribute it and/or modify it
5f08c3bdfSopenharmony_ci * under the terms of version 2 of the GNU General Public License as
6f08c3bdfSopenharmony_ci * published by the Free Software Foundation.
7f08c3bdfSopenharmony_ci *
8f08c3bdfSopenharmony_ci * This program is distributed in the hope that it would be useful, but
9f08c3bdfSopenharmony_ci * WITHOUT ANY WARRANTY; without even the implied warranty of
10f08c3bdfSopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11f08c3bdfSopenharmony_ci *
12f08c3bdfSopenharmony_ci * Further, this software is distributed without any warranty that it is
13f08c3bdfSopenharmony_ci * free of the rightful claim of any third person regarding infringement
14f08c3bdfSopenharmony_ci * or the like.  Any license provided herein, whether implied or
15f08c3bdfSopenharmony_ci * otherwise, applies only to this software file.  Patent licenses, if
16f08c3bdfSopenharmony_ci * any, provided herein do not apply to combinations of this program with
17f08c3bdfSopenharmony_ci * other software, or any other product whatsoever.
18f08c3bdfSopenharmony_ci *
19f08c3bdfSopenharmony_ci * You should have received a copy of the GNU General Public License along
20f08c3bdfSopenharmony_ci * with this program; if not, write the Free Software Foundation, Inc.,
21f08c3bdfSopenharmony_ci * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22f08c3bdfSopenharmony_ci *
23f08c3bdfSopenharmony_ci * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24f08c3bdfSopenharmony_ci * Mountain View, CA  94043, or:
25f08c3bdfSopenharmony_ci *
26f08c3bdfSopenharmony_ci * http://www.sgi.com
27f08c3bdfSopenharmony_ci *
28f08c3bdfSopenharmony_ci * For further information regarding this notice, see:
29f08c3bdfSopenharmony_ci *
30f08c3bdfSopenharmony_ci * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
31f08c3bdfSopenharmony_ci */
32f08c3bdfSopenharmony_ci/************
33f08c3bdfSopenharmony_ci
34f08c3bdfSopenharmony_ci64 bits in a Cray word
35f08c3bdfSopenharmony_ci
36f08c3bdfSopenharmony_ci				12345678901234567890123456789012
37f08c3bdfSopenharmony_ci1234567890123456789012345678901234567890123456789012345678901234
38f08c3bdfSopenharmony_ci________________________________________________________________
39f08c3bdfSopenharmony_ci<    pid       >< word-offset in file (same #) ><    pid       >
40f08c3bdfSopenharmony_ci
41f08c3bdfSopenharmony_ci1234567890123456789012345678901234567890123456789012345678901234
42f08c3bdfSopenharmony_ci________________________________________________________________
43f08c3bdfSopenharmony_ci<    pid       >< offset in file of this word  ><    pid       >
44f08c3bdfSopenharmony_ci
45f08c3bdfSopenharmony_ci8 bits to a bytes == character
46f08c3bdfSopenharmony_ci NBPW            8
47f08c3bdfSopenharmony_ci************/
48f08c3bdfSopenharmony_ci
49f08c3bdfSopenharmony_ci#include <stdio.h>
50f08c3bdfSopenharmony_ci#include <sys/param.h>
51f08c3bdfSopenharmony_ci#ifdef UNIT_TEST
52f08c3bdfSopenharmony_ci#include <unistd.h>
53f08c3bdfSopenharmony_ci#include <stdlib.h>
54f08c3bdfSopenharmony_ci#endif
55f08c3bdfSopenharmony_ci
56f08c3bdfSopenharmony_cistatic char Errmsg[80];
57f08c3bdfSopenharmony_ci
58f08c3bdfSopenharmony_ci#define LOWER16BITS(X)	(X & 0177777)
59f08c3bdfSopenharmony_ci#define LOWER32BITS(X)	(X & 0xffffffff)
60f08c3bdfSopenharmony_ci
61f08c3bdfSopenharmony_ci/***
62f08c3bdfSopenharmony_ci#define HIGHBITS(WRD, bits) ( (-1 << (64-bits)) & WRD)
63f08c3bdfSopenharmony_ci#define LOWBITS(WRD, bits) ( (-1 >> (64-bits)) & WRD)
64f08c3bdfSopenharmony_ci****/
65f08c3bdfSopenharmony_ci
66f08c3bdfSopenharmony_ci#define NBPBYTE		8	/* number bits per byte */
67f08c3bdfSopenharmony_ci
68f08c3bdfSopenharmony_ci#ifndef DEBUG
69f08c3bdfSopenharmony_ci#define DEBUG	0
70f08c3bdfSopenharmony_ci#endif
71f08c3bdfSopenharmony_ci
72f08c3bdfSopenharmony_ci/***********************************************************************
73f08c3bdfSopenharmony_ci *
74f08c3bdfSopenharmony_ci *
75f08c3bdfSopenharmony_ci * 1   2   3   4   5   6   7   8   9   10  11  12  13  14  14  15	bytes
76f08c3bdfSopenharmony_ci * 1234567890123456789012345678901234567890123456789012345678901234	bits
77f08c3bdfSopenharmony_ci * ________________________________________________________________	1 word
78f08c3bdfSopenharmony_ci * <    pid       >< offset in file of this word  ><    pid       >
79f08c3bdfSopenharmony_ci *
80f08c3bdfSopenharmony_ci * the words are put together where offset zero is the start.
81f08c3bdfSopenharmony_ci * thus, offset 16 is the start of  the second full word
82f08c3bdfSopenharmony_ci * Thus, offset 8 is in middle of word 1
83f08c3bdfSopenharmony_ci ***********************************************************************/
84f08c3bdfSopenharmony_ciint datapidgen(int pid, char *buffer, int bsize, int offset)
85f08c3bdfSopenharmony_ci{
86f08c3bdfSopenharmony_ci#if CRAY
87f08c3bdfSopenharmony_ci
88f08c3bdfSopenharmony_ci	int cnt;
89f08c3bdfSopenharmony_ci	int tmp;
90f08c3bdfSopenharmony_ci	char *chr;
91f08c3bdfSopenharmony_ci	long *wptr;
92f08c3bdfSopenharmony_ci	long word;
93f08c3bdfSopenharmony_ci	int woff;		/* file offset for the word */
94f08c3bdfSopenharmony_ci	int boff;		/* buffer offset or index */
95f08c3bdfSopenharmony_ci	int num_full_words;
96f08c3bdfSopenharmony_ci
97f08c3bdfSopenharmony_ci	num_full_words = bsize / NBPW;
98f08c3bdfSopenharmony_ci	boff = 0;
99f08c3bdfSopenharmony_ci
100f08c3bdfSopenharmony_ci	if (cnt = (offset % NBPW)) {	/* partial word */
101f08c3bdfSopenharmony_ci
102f08c3bdfSopenharmony_ci		woff = offset - cnt;
103f08c3bdfSopenharmony_ci#if DEBUG
104f08c3bdfSopenharmony_ci		printf("partial at beginning, cnt = %d, woff = %d\n", cnt,
105f08c3bdfSopenharmony_ci		       woff);
106f08c3bdfSopenharmony_ci#endif
107f08c3bdfSopenharmony_ci
108f08c3bdfSopenharmony_ci		word =
109f08c3bdfSopenharmony_ci		    ((LOWER16BITS(pid) << 48) | (LOWER32BITS(woff) << 16) |
110f08c3bdfSopenharmony_ci		     LOWER16BITS(pid));
111f08c3bdfSopenharmony_ci
112f08c3bdfSopenharmony_ci		chr = (char *)&word;
113f08c3bdfSopenharmony_ci
114f08c3bdfSopenharmony_ci		for (tmp = 0; tmp < cnt; tmp++) {	/* skip unused bytes */
115f08c3bdfSopenharmony_ci			chr++;
116f08c3bdfSopenharmony_ci		}
117f08c3bdfSopenharmony_ci
118f08c3bdfSopenharmony_ci		for (; boff < (NBPW - cnt) && boff < bsize; boff++, chr++) {
119f08c3bdfSopenharmony_ci			buffer[boff] = *chr;
120f08c3bdfSopenharmony_ci		}
121f08c3bdfSopenharmony_ci	}
122f08c3bdfSopenharmony_ci
123f08c3bdfSopenharmony_ci	/*
124f08c3bdfSopenharmony_ci	 * full words
125f08c3bdfSopenharmony_ci	 */
126f08c3bdfSopenharmony_ci
127f08c3bdfSopenharmony_ci	num_full_words = (bsize - boff) / NBPW;
128f08c3bdfSopenharmony_ci
129f08c3bdfSopenharmony_ci	woff = offset + boff;
130f08c3bdfSopenharmony_ci
131f08c3bdfSopenharmony_ci	for (cnt = 0; cnt < num_full_words; woff += NBPW, cnt++) {
132f08c3bdfSopenharmony_ci
133f08c3bdfSopenharmony_ci		word =
134f08c3bdfSopenharmony_ci		    ((LOWER16BITS(pid) << 48) | (LOWER32BITS(woff) << 16) |
135f08c3bdfSopenharmony_ci		     LOWER16BITS(pid));
136f08c3bdfSopenharmony_ci
137f08c3bdfSopenharmony_ci		chr = (char *)&word;
138f08c3bdfSopenharmony_ci		for (tmp = 0; tmp < NBPW; tmp++, chr++) {
139f08c3bdfSopenharmony_ci			buffer[boff++] = *chr;
140f08c3bdfSopenharmony_ci		}
141f08c3bdfSopenharmony_ci/****** Only if wptr is a word ellined
142f08c3bdfSopenharmony_ci	wptr = (long *)&buffer[boff];
143f08c3bdfSopenharmony_ci	*wptr = word;
144f08c3bdfSopenharmony_ci	boff += NBPW;
145f08c3bdfSopenharmony_ci*****/
146f08c3bdfSopenharmony_ci
147f08c3bdfSopenharmony_ci	}
148f08c3bdfSopenharmony_ci
149f08c3bdfSopenharmony_ci	/*
150f08c3bdfSopenharmony_ci	 * partial word at end of buffer
151f08c3bdfSopenharmony_ci	 */
152f08c3bdfSopenharmony_ci
153f08c3bdfSopenharmony_ci	if (cnt = ((bsize - boff) % NBPW)) {
154f08c3bdfSopenharmony_ci#if DEBUG
155f08c3bdfSopenharmony_ci		printf("partial at end\n");
156f08c3bdfSopenharmony_ci#endif
157f08c3bdfSopenharmony_ci		word =
158f08c3bdfSopenharmony_ci		    ((LOWER16BITS(pid) << 48) | (LOWER32BITS(woff) << 16) |
159f08c3bdfSopenharmony_ci		     LOWER16BITS(pid));
160f08c3bdfSopenharmony_ci
161f08c3bdfSopenharmony_ci		chr = (char *)&word;
162f08c3bdfSopenharmony_ci
163f08c3bdfSopenharmony_ci		for (tmp = 0; tmp < cnt && boff < bsize; tmp++, chr++) {
164f08c3bdfSopenharmony_ci			buffer[boff++] = *chr;
165f08c3bdfSopenharmony_ci		}
166f08c3bdfSopenharmony_ci	}
167f08c3bdfSopenharmony_ci
168f08c3bdfSopenharmony_ci	return bsize;
169f08c3bdfSopenharmony_ci
170f08c3bdfSopenharmony_ci#else
171f08c3bdfSopenharmony_ci	return -1;		/* not support on non-64 bits word machines  */
172f08c3bdfSopenharmony_ci
173f08c3bdfSopenharmony_ci#endif
174f08c3bdfSopenharmony_ci
175f08c3bdfSopenharmony_ci}
176f08c3bdfSopenharmony_ci
177f08c3bdfSopenharmony_ci/***********************************************************************
178f08c3bdfSopenharmony_ci *
179f08c3bdfSopenharmony_ci *
180f08c3bdfSopenharmony_ci ***********************************************************************/
181f08c3bdfSopenharmony_ciint datapidchk(int pid, char *buffer, int bsize, int offset, char **errmsg)
182f08c3bdfSopenharmony_ci{
183f08c3bdfSopenharmony_ci#if CRAY
184f08c3bdfSopenharmony_ci
185f08c3bdfSopenharmony_ci	int cnt;
186f08c3bdfSopenharmony_ci	int tmp;
187f08c3bdfSopenharmony_ci	char *chr;
188f08c3bdfSopenharmony_ci	long *wptr;
189f08c3bdfSopenharmony_ci	long word;
190f08c3bdfSopenharmony_ci	int woff;		/* file offset for the word */
191f08c3bdfSopenharmony_ci	int boff;		/* buffer offset or index */
192f08c3bdfSopenharmony_ci	int num_full_words;
193f08c3bdfSopenharmony_ci
194f08c3bdfSopenharmony_ci	if (errmsg != NULL) {
195f08c3bdfSopenharmony_ci		*errmsg = Errmsg;
196f08c3bdfSopenharmony_ci	}
197f08c3bdfSopenharmony_ci
198f08c3bdfSopenharmony_ci	num_full_words = bsize / NBPW;
199f08c3bdfSopenharmony_ci	boff = 0;
200f08c3bdfSopenharmony_ci
201f08c3bdfSopenharmony_ci	if (cnt = (offset % NBPW)) {	/* partial word */
202f08c3bdfSopenharmony_ci		woff = offset - cnt;
203f08c3bdfSopenharmony_ci		word =
204f08c3bdfSopenharmony_ci		    ((LOWER16BITS(pid) << 48) | (LOWER32BITS(woff) << 16) |
205f08c3bdfSopenharmony_ci		     LOWER16BITS(pid));
206f08c3bdfSopenharmony_ci
207f08c3bdfSopenharmony_ci		chr = (char *)&word;
208f08c3bdfSopenharmony_ci
209f08c3bdfSopenharmony_ci		for (tmp = 0; tmp < cnt; tmp++) {	/* skip unused bytes */
210f08c3bdfSopenharmony_ci			chr++;
211f08c3bdfSopenharmony_ci		}
212f08c3bdfSopenharmony_ci
213f08c3bdfSopenharmony_ci		for (; boff < (NBPW - cnt) && boff < bsize; boff++, chr++) {
214f08c3bdfSopenharmony_ci			if (buffer[boff] != *chr) {
215f08c3bdfSopenharmony_ci				sprintf(Errmsg,
216f08c3bdfSopenharmony_ci					"Data mismatch at offset %d, exp:%#o, act:%#o",
217f08c3bdfSopenharmony_ci					offset + boff, *chr, buffer[boff]);
218f08c3bdfSopenharmony_ci				return offset + boff;
219f08c3bdfSopenharmony_ci			}
220f08c3bdfSopenharmony_ci		}
221f08c3bdfSopenharmony_ci	}
222f08c3bdfSopenharmony_ci
223f08c3bdfSopenharmony_ci	/*
224f08c3bdfSopenharmony_ci	 * full words
225f08c3bdfSopenharmony_ci	 */
226f08c3bdfSopenharmony_ci
227f08c3bdfSopenharmony_ci	num_full_words = (bsize - boff) / NBPW;
228f08c3bdfSopenharmony_ci
229f08c3bdfSopenharmony_ci	woff = offset + boff;
230f08c3bdfSopenharmony_ci
231f08c3bdfSopenharmony_ci	for (cnt = 0; cnt < num_full_words; woff += NBPW, cnt++) {
232f08c3bdfSopenharmony_ci		word =
233f08c3bdfSopenharmony_ci		    ((LOWER16BITS(pid) << 48) | (LOWER32BITS(woff) << 16) |
234f08c3bdfSopenharmony_ci		     LOWER16BITS(pid));
235f08c3bdfSopenharmony_ci
236f08c3bdfSopenharmony_ci		chr = (char *)&word;
237f08c3bdfSopenharmony_ci		for (tmp = 0; tmp < NBPW; tmp++, boff++, chr++) {
238f08c3bdfSopenharmony_ci			if (buffer[boff] != *chr) {
239f08c3bdfSopenharmony_ci				sprintf(Errmsg,
240f08c3bdfSopenharmony_ci					"Data mismatch at offset %d, exp:%#o, act:%#o",
241f08c3bdfSopenharmony_ci					woff, *chr, buffer[boff]);
242f08c3bdfSopenharmony_ci				return woff;
243f08c3bdfSopenharmony_ci			}
244f08c3bdfSopenharmony_ci		}
245f08c3bdfSopenharmony_ci
246f08c3bdfSopenharmony_ci/****** only if a word elined
247f08c3bdfSopenharmony_ci	wptr = (long *)&buffer[boff];
248f08c3bdfSopenharmony_ci	if (*wptr != word) {
249f08c3bdfSopenharmony_ci	    sprintf(Errmsg, "Data mismatch at offset %d, exp:%#o, act:%#o",
250f08c3bdfSopenharmony_ci	        woff, word, *wptr);
251f08c3bdfSopenharmony_ci	    return woff;
252f08c3bdfSopenharmony_ci	}
253f08c3bdfSopenharmony_ci	boff += NBPW;
254f08c3bdfSopenharmony_ci******/
255f08c3bdfSopenharmony_ci	}
256f08c3bdfSopenharmony_ci
257f08c3bdfSopenharmony_ci	/*
258f08c3bdfSopenharmony_ci	 * partial word at end of buffer
259f08c3bdfSopenharmony_ci	 */
260f08c3bdfSopenharmony_ci
261f08c3bdfSopenharmony_ci	if (cnt = ((bsize - boff) % NBPW)) {
262f08c3bdfSopenharmony_ci#if DEBUG
263f08c3bdfSopenharmony_ci		printf("partial at end\n");
264f08c3bdfSopenharmony_ci#endif
265f08c3bdfSopenharmony_ci		word =
266f08c3bdfSopenharmony_ci		    ((LOWER16BITS(pid) << 48) | (LOWER32BITS(woff) << 16) |
267f08c3bdfSopenharmony_ci		     LOWER16BITS(pid));
268f08c3bdfSopenharmony_ci
269f08c3bdfSopenharmony_ci		chr = (char *)&word;
270f08c3bdfSopenharmony_ci
271f08c3bdfSopenharmony_ci		for (tmp = 0; tmp < cnt && boff < bsize; boff++, tmp++, chr++) {
272f08c3bdfSopenharmony_ci			if (buffer[boff] != *chr) {
273f08c3bdfSopenharmony_ci				sprintf(Errmsg,
274f08c3bdfSopenharmony_ci					"Data mismatch at offset %d, exp:%#o, act:%#o",
275f08c3bdfSopenharmony_ci					offset + boff, *chr, buffer[boff]);
276f08c3bdfSopenharmony_ci				return offset + boff;
277f08c3bdfSopenharmony_ci			}
278f08c3bdfSopenharmony_ci		}
279f08c3bdfSopenharmony_ci	}
280f08c3bdfSopenharmony_ci
281f08c3bdfSopenharmony_ci	sprintf(Errmsg, "all %d bytes match desired pattern", bsize);
282f08c3bdfSopenharmony_ci	return -1;		/* buffer is ok */
283f08c3bdfSopenharmony_ci
284f08c3bdfSopenharmony_ci#else
285f08c3bdfSopenharmony_ci
286f08c3bdfSopenharmony_ci	if (errmsg != NULL) {
287f08c3bdfSopenharmony_ci		*errmsg = Errmsg;
288f08c3bdfSopenharmony_ci	}
289f08c3bdfSopenharmony_ci	sprintf(Errmsg, "Not supported on this OS.");
290f08c3bdfSopenharmony_ci	return 0;
291f08c3bdfSopenharmony_ci
292f08c3bdfSopenharmony_ci#endif
293f08c3bdfSopenharmony_ci
294f08c3bdfSopenharmony_ci}				/* end of datapidchk */
295f08c3bdfSopenharmony_ci
296f08c3bdfSopenharmony_ci#if UNIT_TEST
297f08c3bdfSopenharmony_ci
298f08c3bdfSopenharmony_ci/***********************************************************************
299f08c3bdfSopenharmony_ci * main for doing unit testing
300f08c3bdfSopenharmony_ci ***********************************************************************/
301f08c3bdfSopenharmony_ciint main(ac, ag)
302f08c3bdfSopenharmony_ciint ac;
303f08c3bdfSopenharmony_cichar **ag;
304f08c3bdfSopenharmony_ci{
305f08c3bdfSopenharmony_ci
306f08c3bdfSopenharmony_ci	int size = 1234;
307f08c3bdfSopenharmony_ci	char *buffer;
308f08c3bdfSopenharmony_ci	int ret;
309f08c3bdfSopenharmony_ci	char *errmsg;
310f08c3bdfSopenharmony_ci
311f08c3bdfSopenharmony_ci	if ((buffer = (char *)malloc(size)) == NULL) {
312f08c3bdfSopenharmony_ci		perror("malloc");
313f08c3bdfSopenharmony_ci		exit(2);
314f08c3bdfSopenharmony_ci	}
315f08c3bdfSopenharmony_ci
316f08c3bdfSopenharmony_ci	datapidgen(-1, buffer, size, 3);
317f08c3bdfSopenharmony_ci
318f08c3bdfSopenharmony_ci/***
319f08c3bdfSopenharmony_cifwrite(buffer, size, 1, stdout);
320f08c3bdfSopenharmony_cifwrite("\n", 1, 1, stdout);
321f08c3bdfSopenharmony_ci****/
322f08c3bdfSopenharmony_ci
323f08c3bdfSopenharmony_ci	printf("datapidgen(-1, buffer, size, 3)\n");
324f08c3bdfSopenharmony_ci
325f08c3bdfSopenharmony_ci	ret = datapidchk(-1, buffer, size, 3, &errmsg);
326f08c3bdfSopenharmony_ci	printf("datapidchk(-1, buffer, %d, 3, &errmsg) returned %d %s\n",
327f08c3bdfSopenharmony_ci	       size, ret, errmsg);
328f08c3bdfSopenharmony_ci	ret = datapidchk(-1, &buffer[1], size - 1, 4, &errmsg);
329f08c3bdfSopenharmony_ci	printf("datapidchk(-1, &buffer[1], %d, 4, &errmsg) returned %d %s\n",
330f08c3bdfSopenharmony_ci	       size - 1, ret, errmsg);
331f08c3bdfSopenharmony_ci
332f08c3bdfSopenharmony_ci	buffer[25] = 0x0;
333f08c3bdfSopenharmony_ci	buffer[26] = 0x0;
334f08c3bdfSopenharmony_ci	buffer[27] = 0x0;
335f08c3bdfSopenharmony_ci	buffer[28] = 0x0;
336f08c3bdfSopenharmony_ci	printf("changing char 25-28\n");
337f08c3bdfSopenharmony_ci
338f08c3bdfSopenharmony_ci	ret = datapidchk(-1, &buffer[1], size - 1, 4, &errmsg);
339f08c3bdfSopenharmony_ci	printf("datapidchk(-1, &buffer[1], %d, 4, &errmsg) returned %d %s\n",
340f08c3bdfSopenharmony_ci	       size - 1, ret, errmsg);
341f08c3bdfSopenharmony_ci
342f08c3bdfSopenharmony_ci	printf("------------------------------------------\n");
343f08c3bdfSopenharmony_ci
344f08c3bdfSopenharmony_ci	datapidgen(getpid(), buffer, size, 5);
345f08c3bdfSopenharmony_ci
346f08c3bdfSopenharmony_ci/*******
347f08c3bdfSopenharmony_cifwrite(buffer, size, 1, stdout);
348f08c3bdfSopenharmony_cifwrite("\n", 1, 1, stdout);
349f08c3bdfSopenharmony_ci******/
350f08c3bdfSopenharmony_ci
351f08c3bdfSopenharmony_ci	printf("\ndatapidgen(getpid(), buffer, size, 5)\n");
352f08c3bdfSopenharmony_ci
353f08c3bdfSopenharmony_ci	ret = datapidchk(getpid(), buffer, size, 5, &errmsg);
354f08c3bdfSopenharmony_ci	printf("datapidchk(getpid(), buffer, %d, 5, &errmsg) returned %d %s\n",
355f08c3bdfSopenharmony_ci	       size, ret, errmsg);
356f08c3bdfSopenharmony_ci
357f08c3bdfSopenharmony_ci	ret = datapidchk(getpid(), &buffer[1], size - 1, 6, &errmsg);
358f08c3bdfSopenharmony_ci	printf
359f08c3bdfSopenharmony_ci	    ("datapidchk(getpid(), &buffer[1], %d, 6, &errmsg) returned %d %s\n",
360f08c3bdfSopenharmony_ci	     size - 1, ret, errmsg);
361f08c3bdfSopenharmony_ci
362f08c3bdfSopenharmony_ci	buffer[25] = 0x0;
363f08c3bdfSopenharmony_ci	printf("changing char 25\n");
364f08c3bdfSopenharmony_ci
365f08c3bdfSopenharmony_ci	ret = datapidchk(getpid(), &buffer[1], size - 1, 6, &errmsg);
366f08c3bdfSopenharmony_ci	printf
367f08c3bdfSopenharmony_ci	    ("datapidchk(getpid(), &buffer[1], %d, 6, &errmsg) returned %d %s\n",
368f08c3bdfSopenharmony_ci	     size - 1, ret, errmsg);
369f08c3bdfSopenharmony_ci
370f08c3bdfSopenharmony_ci	exit(0);
371f08c3bdfSopenharmony_ci}
372f08c3bdfSopenharmony_ci
373f08c3bdfSopenharmony_ci#endif
374