1 | .. SPDX-License-Identifier: CC-BY-SA-4.0 |
---|
2 | |
---|
3 | .. Copyright (C) 1988, 2002 On-Line Applications Research Corporation (OAR) |
---|
4 | |
---|
5 | Language-Specific Services for the C Programming Language Manager |
---|
6 | ################################################################# |
---|
7 | |
---|
8 | Introduction |
---|
9 | ============ |
---|
10 | |
---|
11 | The language-specific services for the C programming language manager is ... |
---|
12 | |
---|
13 | The directives provided by the language-specific services for the C programming language manager are: |
---|
14 | |
---|
15 | - setlocale_ - Set the Current Locale |
---|
16 | |
---|
17 | - fileno_ - Obtain File Descriptor Number for this File |
---|
18 | |
---|
19 | - fdopen_ - Associate Stream with File Descriptor |
---|
20 | |
---|
21 | - flockfile_ - Acquire Ownership of File Stream |
---|
22 | |
---|
23 | - ftrylockfile_ - Poll to Acquire Ownership of File Stream |
---|
24 | |
---|
25 | - funlockfile_ - Release Ownership of File Stream |
---|
26 | |
---|
27 | - getc_unlocked_ - Get Character without Locking |
---|
28 | |
---|
29 | - getchar_unlocked_ - Get Character from stdin without Locking |
---|
30 | |
---|
31 | - putc_unlocked_ - Put Character without Locking |
---|
32 | |
---|
33 | - putchar_unlocked_ - Put Character to stdin without Locking |
---|
34 | |
---|
35 | - setjmp_ - Save Context for Non-Local Goto |
---|
36 | |
---|
37 | - longjmp_ - Non-Local Jump to a Saved Context |
---|
38 | |
---|
39 | - sigsetjmp_ - Save Context with Signal Status for Non-Local Goto |
---|
40 | |
---|
41 | - siglongjmp_ - Non-Local Jump with Signal Status to a Saved Context |
---|
42 | |
---|
43 | - tzset_ - Initialize Time Conversion Information |
---|
44 | |
---|
45 | - strtok_r_ - Reentrant Extract Token from String |
---|
46 | |
---|
47 | - asctime_r_ - Reentrant struct tm to ASCII Time Conversion |
---|
48 | |
---|
49 | - ctime_r_ - Reentrant time_t to ASCII Time Conversion |
---|
50 | |
---|
51 | - gmtime_r_ - Reentrant UTC Time Conversion |
---|
52 | |
---|
53 | - localtime_r_ - Reentrant Local Time Conversion |
---|
54 | |
---|
55 | - rand_r_ - Reentrant Random Number Generation |
---|
56 | |
---|
57 | Background |
---|
58 | ========== |
---|
59 | |
---|
60 | There is currently no text in this section. |
---|
61 | |
---|
62 | Operations |
---|
63 | ========== |
---|
64 | |
---|
65 | There is currently no text in this section. |
---|
66 | |
---|
67 | Directives |
---|
68 | ========== |
---|
69 | |
---|
70 | This section details the language-specific services for the C programming |
---|
71 | language manager's directives. A subsection is dedicated to each of this |
---|
72 | manager's directives and describes the calling sequence, related constants, |
---|
73 | usage, and status codes. |
---|
74 | |
---|
75 | .. _setlocale: |
---|
76 | |
---|
77 | setlocale - Set the Current Locale |
---|
78 | ---------------------------------- |
---|
79 | .. index:: setlocale |
---|
80 | .. index:: set the current locale |
---|
81 | |
---|
82 | **CALLING SEQUENCE:** |
---|
83 | |
---|
84 | .. code-block:: c |
---|
85 | |
---|
86 | #include <locale.h> |
---|
87 | char *setlocale(int category, const char *locale); |
---|
88 | |
---|
89 | **STATUS CODES:** |
---|
90 | |
---|
91 | .. list-table:: |
---|
92 | :class: rtems-table |
---|
93 | |
---|
94 | * - ``E`` |
---|
95 | - The |
---|
96 | |
---|
97 | **DESCRIPTION:** |
---|
98 | |
---|
99 | **NOTES:** |
---|
100 | |
---|
101 | .. _fileno: |
---|
102 | |
---|
103 | fileno - Obtain File Descriptor Number for this File |
---|
104 | ---------------------------------------------------- |
---|
105 | .. index:: fileno |
---|
106 | .. index:: obtain file descriptor number for this file |
---|
107 | |
---|
108 | **CALLING SEQUENCE:** |
---|
109 | |
---|
110 | .. code-block:: c |
---|
111 | |
---|
112 | #include <stdio.h> |
---|
113 | int fileno(FILE *stream); |
---|
114 | |
---|
115 | **STATUS CODES:** |
---|
116 | |
---|
117 | .. list-table:: |
---|
118 | :class: rtems-table |
---|
119 | |
---|
120 | * - ``E`` |
---|
121 | - The |
---|
122 | |
---|
123 | **DESCRIPTION:** |
---|
124 | |
---|
125 | **NOTES:** |
---|
126 | |
---|
127 | .. _fdopen: |
---|
128 | |
---|
129 | fdopen - Associate Stream with File Descriptor |
---|
130 | ---------------------------------------------- |
---|
131 | .. index:: fdopen |
---|
132 | .. index:: associate stream with file descriptor |
---|
133 | |
---|
134 | **CALLING SEQUENCE:** |
---|
135 | |
---|
136 | .. code-block:: c |
---|
137 | |
---|
138 | #include <stdio.h> |
---|
139 | FILE *fdopen(int fildes, const char *mode); |
---|
140 | |
---|
141 | **STATUS CODES:** |
---|
142 | |
---|
143 | .. list-table:: |
---|
144 | :class: rtems-table |
---|
145 | |
---|
146 | * - ``E`` |
---|
147 | - The |
---|
148 | |
---|
149 | **DESCRIPTION:** |
---|
150 | |
---|
151 | **NOTES:** |
---|
152 | |
---|
153 | .. _flockfile: |
---|
154 | |
---|
155 | flockfile - Acquire Ownership of File Stream |
---|
156 | -------------------------------------------- |
---|
157 | .. index:: flockfile |
---|
158 | .. index:: acquire ownership of file stream |
---|
159 | |
---|
160 | **CALLING SEQUENCE:** |
---|
161 | |
---|
162 | .. code-block:: c |
---|
163 | |
---|
164 | #include <stdio.h> |
---|
165 | void flockfile(FILE *file); |
---|
166 | |
---|
167 | **STATUS CODES:** |
---|
168 | |
---|
169 | .. list-table:: |
---|
170 | :class: rtems-table |
---|
171 | |
---|
172 | * - ``E`` |
---|
173 | - The |
---|
174 | |
---|
175 | **DESCRIPTION:** |
---|
176 | |
---|
177 | **NOTES:** |
---|
178 | |
---|
179 | .. _ftrylockfile: |
---|
180 | |
---|
181 | ftrylockfile - Poll to Acquire Ownership of File Stream |
---|
182 | ------------------------------------------------------- |
---|
183 | .. index:: ftrylockfile |
---|
184 | .. index:: poll to acquire ownership of file stream |
---|
185 | |
---|
186 | **CALLING SEQUENCE:** |
---|
187 | |
---|
188 | .. code-block:: c |
---|
189 | |
---|
190 | #include <stdio.h> |
---|
191 | int ftrylockfile(FILE *file); |
---|
192 | |
---|
193 | **STATUS CODES:** |
---|
194 | |
---|
195 | .. list-table:: |
---|
196 | :class: rtems-table |
---|
197 | |
---|
198 | * - ``E`` |
---|
199 | - The |
---|
200 | |
---|
201 | **DESCRIPTION:** |
---|
202 | |
---|
203 | **NOTES:** |
---|
204 | |
---|
205 | .. _funlockfile: |
---|
206 | |
---|
207 | funlockfile - Release Ownership of File Stream |
---|
208 | ---------------------------------------------- |
---|
209 | .. index:: funlockfile |
---|
210 | .. index:: release ownership of file stream |
---|
211 | |
---|
212 | **CALLING SEQUENCE:** |
---|
213 | |
---|
214 | .. code-block:: c |
---|
215 | |
---|
216 | #include <stdio.h> |
---|
217 | void funlockfile(FILE *file); |
---|
218 | |
---|
219 | **STATUS CODES:** |
---|
220 | |
---|
221 | .. list-table:: |
---|
222 | :class: rtems-table |
---|
223 | |
---|
224 | * - ``E`` |
---|
225 | - The |
---|
226 | |
---|
227 | **DESCRIPTION:** |
---|
228 | |
---|
229 | **NOTES:** |
---|
230 | |
---|
231 | .. _getc_unlocked: |
---|
232 | |
---|
233 | getc_unlocked - Get Character without Locking |
---|
234 | --------------------------------------------- |
---|
235 | .. index:: getc_unlocked |
---|
236 | .. index:: get character without locking |
---|
237 | |
---|
238 | **CALLING SEQUENCE:** |
---|
239 | |
---|
240 | .. code-block:: c |
---|
241 | |
---|
242 | #include <stdio.h> |
---|
243 | int getc_unlocked(FILE *stream); |
---|
244 | |
---|
245 | **STATUS CODES:** |
---|
246 | |
---|
247 | .. list-table:: |
---|
248 | :class: rtems-table |
---|
249 | |
---|
250 | * - ``E`` |
---|
251 | - The |
---|
252 | |
---|
253 | **DESCRIPTION:** |
---|
254 | |
---|
255 | **NOTES:** |
---|
256 | |
---|
257 | .. _getchar_unlocked: |
---|
258 | |
---|
259 | getchar_unlocked - Get Character from stdin without Locking |
---|
260 | ----------------------------------------------------------- |
---|
261 | .. index:: getchar_unlocked |
---|
262 | .. index:: get character from stdin without locking |
---|
263 | |
---|
264 | **CALLING SEQUENCE:** |
---|
265 | |
---|
266 | .. code-block:: c |
---|
267 | |
---|
268 | #include <stdio.h> |
---|
269 | int getchar_unlocked(void); |
---|
270 | |
---|
271 | **STATUS CODES:** |
---|
272 | |
---|
273 | .. list-table:: |
---|
274 | :class: rtems-table |
---|
275 | |
---|
276 | * - ``E`` |
---|
277 | - The |
---|
278 | |
---|
279 | **DESCRIPTION:** |
---|
280 | |
---|
281 | **NOTES:** |
---|
282 | |
---|
283 | .. _putc_unlocked: |
---|
284 | |
---|
285 | putc_unlocked - Put Character without Locking |
---|
286 | --------------------------------------------- |
---|
287 | .. index:: putc_unlocked |
---|
288 | .. index:: put character without locking |
---|
289 | |
---|
290 | **CALLING SEQUENCE:** |
---|
291 | |
---|
292 | .. code-block:: c |
---|
293 | |
---|
294 | #include <stdio.h> |
---|
295 | int putc_unlocked(int c, FILE *stream); |
---|
296 | |
---|
297 | **STATUS CODES:** |
---|
298 | |
---|
299 | .. list-table:: |
---|
300 | :class: rtems-table |
---|
301 | |
---|
302 | * - ``E`` |
---|
303 | - The |
---|
304 | |
---|
305 | **DESCRIPTION:** |
---|
306 | |
---|
307 | **NOTES:** |
---|
308 | |
---|
309 | .. _putchar_unlocked: |
---|
310 | |
---|
311 | putchar_unlocked - Put Character to stdin without Locking |
---|
312 | --------------------------------------------------------- |
---|
313 | .. index:: putchar_unlocked |
---|
314 | .. index:: put character to stdin without locking |
---|
315 | |
---|
316 | **CALLING SEQUENCE:** |
---|
317 | |
---|
318 | .. code-block:: c |
---|
319 | |
---|
320 | #include <stdio.h> |
---|
321 | int putchar_unlocked(int c); |
---|
322 | |
---|
323 | **STATUS CODES:** |
---|
324 | |
---|
325 | .. list-table:: |
---|
326 | :class: rtems-table |
---|
327 | |
---|
328 | * - ``E`` |
---|
329 | - The |
---|
330 | |
---|
331 | **DESCRIPTION:** |
---|
332 | |
---|
333 | **NOTES:** |
---|
334 | |
---|
335 | .. _setjmp: |
---|
336 | |
---|
337 | setjmp - Save Context for Non-Local Goto |
---|
338 | ---------------------------------------- |
---|
339 | .. index:: setjmp |
---|
340 | .. index:: save context for non |
---|
341 | |
---|
342 | **CALLING SEQUENCE:** |
---|
343 | |
---|
344 | .. code-block:: c |
---|
345 | |
---|
346 | #include <setjmp.h> |
---|
347 | int setjmp(jmp_buf env); |
---|
348 | |
---|
349 | **STATUS CODES:** |
---|
350 | |
---|
351 | .. list-table:: |
---|
352 | :class: rtems-table |
---|
353 | |
---|
354 | * - ``E`` |
---|
355 | - The |
---|
356 | |
---|
357 | **DESCRIPTION:** |
---|
358 | |
---|
359 | **NOTES:** |
---|
360 | |
---|
361 | .. _longjmp: |
---|
362 | |
---|
363 | longjmp - Non-Local Jump to a Saved Context |
---|
364 | ------------------------------------------- |
---|
365 | .. index:: longjmp |
---|
366 | .. index:: non |
---|
367 | |
---|
368 | **CALLING SEQUENCE:** |
---|
369 | |
---|
370 | .. code-block:: c |
---|
371 | |
---|
372 | #include <setjmp.h> |
---|
373 | void longjmp(jmp_buf env, int val); |
---|
374 | |
---|
375 | **STATUS CODES:** |
---|
376 | |
---|
377 | .. list-table:: |
---|
378 | :class: rtems-table |
---|
379 | |
---|
380 | * - ``E`` |
---|
381 | - The |
---|
382 | |
---|
383 | **DESCRIPTION:** |
---|
384 | |
---|
385 | **NOTES:** |
---|
386 | |
---|
387 | .. _sigsetjmp: |
---|
388 | |
---|
389 | sigsetjmp - Save Context with Signal Status for Non-Local Goto |
---|
390 | -------------------------------------------------------------- |
---|
391 | .. index:: sigsetjmp |
---|
392 | .. index:: save context with signal status for non |
---|
393 | |
---|
394 | **CALLING SEQUENCE:** |
---|
395 | |
---|
396 | .. code-block:: c |
---|
397 | |
---|
398 | #include <setjmp.h> |
---|
399 | int sigsetjmp(sigjmp_buf env, int savemask); |
---|
400 | |
---|
401 | **STATUS CODES:** |
---|
402 | |
---|
403 | .. list-table:: |
---|
404 | :class: rtems-table |
---|
405 | |
---|
406 | * - ``E`` |
---|
407 | - The |
---|
408 | |
---|
409 | **DESCRIPTION:** |
---|
410 | |
---|
411 | **NOTES:** |
---|
412 | |
---|
413 | .. _siglongjmp: |
---|
414 | |
---|
415 | siglongjmp - Non-Local Jump with Signal Status to a Saved Context |
---|
416 | ----------------------------------------------------------------- |
---|
417 | .. index:: siglongjmp |
---|
418 | .. index:: non |
---|
419 | |
---|
420 | **CALLING SEQUENCE:** |
---|
421 | |
---|
422 | .. code-block:: c |
---|
423 | |
---|
424 | #include <setjmp.h> |
---|
425 | void siglongjmp(sigjmp_buf env, int val); |
---|
426 | |
---|
427 | **STATUS CODES:** |
---|
428 | |
---|
429 | .. list-table:: |
---|
430 | :class: rtems-table |
---|
431 | |
---|
432 | * - ``E`` |
---|
433 | - The |
---|
434 | |
---|
435 | **DESCRIPTION:** |
---|
436 | |
---|
437 | **NOTES:** |
---|
438 | |
---|
439 | .. _tzset: |
---|
440 | |
---|
441 | tzset - Initialize Time Conversion Information |
---|
442 | ---------------------------------------------- |
---|
443 | .. index:: tzset |
---|
444 | .. index:: initialize time conversion information |
---|
445 | |
---|
446 | **CALLING SEQUENCE:** |
---|
447 | |
---|
448 | .. code-block:: c |
---|
449 | |
---|
450 | #include <time.h> |
---|
451 | extern int daylight; |
---|
452 | extern long timezone; |
---|
453 | extern char *tzname[2]; |
---|
454 | void tzset(void); |
---|
455 | |
---|
456 | **STATUS CODES:** |
---|
457 | |
---|
458 | .. list-table:: |
---|
459 | :class: rtems-table |
---|
460 | |
---|
461 | * - ``E`` |
---|
462 | - The |
---|
463 | |
---|
464 | **DESCRIPTION:** |
---|
465 | |
---|
466 | **NOTES:** |
---|
467 | |
---|
468 | .. _strtok_r: |
---|
469 | |
---|
470 | strtok_r - Reentrant Extract Token from String |
---|
471 | ---------------------------------------------- |
---|
472 | .. index:: strtok_r |
---|
473 | .. index:: reentrant extract token from string |
---|
474 | |
---|
475 | **CALLING SEQUENCE:** |
---|
476 | |
---|
477 | .. code-block:: c |
---|
478 | |
---|
479 | #include <string.h> |
---|
480 | char *strtok_r(char *restrict s, const char *restrict sep, |
---|
481 | char **restrict state); |
---|
482 | |
---|
483 | **STATUS CODES:** |
---|
484 | |
---|
485 | .. list-table:: |
---|
486 | :class: rtems-table |
---|
487 | |
---|
488 | * - ``E`` |
---|
489 | - The |
---|
490 | |
---|
491 | **DESCRIPTION:** |
---|
492 | |
---|
493 | **NOTES:** |
---|
494 | |
---|
495 | .. _asctime_r: |
---|
496 | |
---|
497 | asctime_r - Reentrant struct tm to ASCII Time Conversion |
---|
498 | -------------------------------------------------------- |
---|
499 | .. index:: asctime_r |
---|
500 | .. index:: reentrant struct tm to ascii time conversion |
---|
501 | |
---|
502 | **CALLING SEQUENCE:** |
---|
503 | |
---|
504 | .. code-block:: c |
---|
505 | |
---|
506 | #include <time.h> |
---|
507 | char *asctime_r(const struct tm *restrict tm, char *restrict buf); |
---|
508 | |
---|
509 | **STATUS CODES:** |
---|
510 | |
---|
511 | .. list-table:: |
---|
512 | :class: rtems-table |
---|
513 | |
---|
514 | * - ``E`` |
---|
515 | - The |
---|
516 | |
---|
517 | **DESCRIPTION:** |
---|
518 | |
---|
519 | **NOTES:** |
---|
520 | |
---|
521 | .. _ctime_r: |
---|
522 | |
---|
523 | ctime_r - Reentrant time_t to ASCII Time Conversion |
---|
524 | --------------------------------------------------- |
---|
525 | .. index:: ctime_r |
---|
526 | .. index:: reentrant time_t to ascii time conversion |
---|
527 | |
---|
528 | **CALLING SEQUENCE:** |
---|
529 | |
---|
530 | .. code-block:: c |
---|
531 | |
---|
532 | #include <time.h> |
---|
533 | char *ctime_r(const time_t *clock, char *buf); |
---|
534 | |
---|
535 | **STATUS CODES:** |
---|
536 | |
---|
537 | .. list-table:: |
---|
538 | :class: rtems-table |
---|
539 | |
---|
540 | * - ``E`` |
---|
541 | - The |
---|
542 | |
---|
543 | **DESCRIPTION:** |
---|
544 | |
---|
545 | **NOTES:** |
---|
546 | |
---|
547 | .. _gmtime_r: |
---|
548 | |
---|
549 | gmtime_r - Reentrant UTC Time Conversion |
---|
550 | ---------------------------------------- |
---|
551 | .. index:: gmtime_r |
---|
552 | .. index:: reentrant utc time conversion |
---|
553 | |
---|
554 | **CALLING SEQUENCE:** |
---|
555 | |
---|
556 | .. code-block:: c |
---|
557 | |
---|
558 | #include <time.h> |
---|
559 | struct tm *gmtime_r(const time_t *restrict timer, |
---|
560 | struct tm *restrict result); |
---|
561 | |
---|
562 | **STATUS CODES:** |
---|
563 | |
---|
564 | .. list-table:: |
---|
565 | :class: rtems-table |
---|
566 | |
---|
567 | * - ``E`` |
---|
568 | - The |
---|
569 | |
---|
570 | **DESCRIPTION:** |
---|
571 | |
---|
572 | **NOTES:** |
---|
573 | |
---|
574 | .. _localtime_r: |
---|
575 | |
---|
576 | localtime_r - Reentrant Local Time Conversion |
---|
577 | --------------------------------------------- |
---|
578 | .. index:: localtime_r |
---|
579 | .. index:: reentrant local time conversion |
---|
580 | |
---|
581 | **CALLING SEQUENCE:** |
---|
582 | |
---|
583 | .. code-block:: c |
---|
584 | |
---|
585 | #include <time.h> |
---|
586 | struct tm *localtime_r(const time_t *restrict timer, |
---|
587 | struct tm *restrict result); |
---|
588 | |
---|
589 | **STATUS CODES:** |
---|
590 | |
---|
591 | .. list-table:: |
---|
592 | :class: rtems-table |
---|
593 | |
---|
594 | * - ``E`` |
---|
595 | - The |
---|
596 | |
---|
597 | **DESCRIPTION:** |
---|
598 | |
---|
599 | **NOTES:** |
---|
600 | |
---|
601 | .. _rand_r: |
---|
602 | |
---|
603 | rand_r - Reentrant Random Number Generation |
---|
604 | ------------------------------------------- |
---|
605 | .. index:: rand_r |
---|
606 | .. index:: reentrant random number generation |
---|
607 | |
---|
608 | **CALLING SEQUENCE:** |
---|
609 | |
---|
610 | .. code-block:: c |
---|
611 | |
---|
612 | #include <stdlib.h> |
---|
613 | int rand_r(unsigned *seed); |
---|
614 | |
---|
615 | **STATUS CODES:** |
---|
616 | |
---|
617 | .. list-table:: |
---|
618 | :class: rtems-table |
---|
619 | |
---|
620 | * - ``E`` |
---|
621 | - The |
---|
622 | |
---|
623 | **DESCRIPTION:** |
---|
624 | |
---|
625 | **NOTES:** |
---|