1 uClibc thread-safety analysis
2 By Steve Thayer <sthayer@coactive.com>
3 with updates by Erik Andersen <andersee@debian.org>
7 The purpose of this document is to identify the things that need to be done
8 to the uClibc C library in order to make it thread-safe. The goal is to be
9 able to use a pthreads thread implementation under uClinux, using the uClibc
10 C library. To help identify the things that require changing, I used David R.
11 Butenhof's book Programming With POSIX Threads, the source code for the
12 glibc 2.1.3 C library, and the source code for the C library included in the
13 Proventhreads distribution.
17 Butenhof, David R., Programming With POSIX Threads, Addison Wesley Longman, Inc., Reading, MA, ISBN 0-201-63392-2, 1997.
20 The GNU C library is available from the Free Software Foundation
21 http://www.gnu.org/software/libc/libc.html
23 Proventhreads is part of the Inferno Operating system.
24 http://www.vitanuova.com/inferno/index.html
29 1.1 Buffer access mutexes
31 The following functions are required in order to protect shared
32 I/O buffers from being accessed by more than one thread at a time.
33 None of these functions are currently implemented in the uClibc
34 library, so they must be added.
36 flockfile <required> <---
37 ftrylockfile <required> <---
38 funlockfile <required> <---
40 1.2 Functions that must use buffer access mutexes, according to Butenhof
42 The following functions are identified by Butenhof as needing to use
43 buffer access mutexes. This does not represent all functions that
44 need to use the mutexes.
46 getc <mutex required> <---
47 getchar <mutex required> <---
48 putc <mutex required> <---
49 putchar <mutex required> <---
51 1.3 Functions from glibc (libio) that use buffer access mutexes
53 The following functions are functions found in glibc that currently
54 use the buffer access mutexes. Comments in brackets represent
55 status of uClibc with regard to these functions. Most of these
56 functions aren't even supported under uClibc, so no work is required.
57 The rest may require the access mutex. (These must be analyzed on a
60 clearerr <mutex required> <---
61 feof <mutex required> <---
62 ferror <mutex required> <---
63 fputc <mutex required> <---
64 fputwc <not supported>
65 freopen <mutex required> <---
66 freopen64 <not supported>
67 fseek <mutex required> <---
68 fseeko <not supported>
69 fseeko64 <not supported>
70 ftello <not supported>
71 ftello64 <not supported>
73 getc <macro for fgetc>
74 getchar <macro for fgetc>
76 getwchar <not supported>
77 iofclose <not supported>
78 iofflush <not supported>
79 iofgetpos <not supported>
80 iofgetpos64 <not supported>
81 iofgets <not supported>
82 iofgetws <not supported>
83 iofputs <not supported>
84 iofputws <not supported>
85 iofread <not supported>
86 iofsetpos <not supported>
87 iofsetpos64 <not supported>
88 ioftell <not supported>
89 iofwrite <not supported>
90 iogetdelim <not supported>
91 iogets <not supported>
92 ioputs <not supported>
93 ioseekoff <not supported>
94 ioseekpos <not supported>
95 iosetbuffer <not supported>
96 iosetvbuf <not supported>
97 ioungetc <not supported>
98 ioungetwc <not supported>
99 oldiofclose <not supported>
100 oldiofgetpos <not supported>
101 oldiofgetpos64 <not supported>
102 oldiofsetpos <not supported>
103 oldiofsetpos64 <not supported>
104 peekc <not supported>
105 putc <macro for fputc>
106 putchar <macro for fputc>
107 putwc <not supported>
108 putwchar <not supported>
109 rewind <mutex required> <---
111 1.4 Functions from Proventhreads that use buffer access mutexes
113 See description above. This applies only to the C library included
114 in the proventhreads distribution.
116 clearerr <mutex required> <---
117 fclose <mutex required> <---
118 fflush <mutex required> <---
119 fgetc <mutex required> <---
120 __getc <not supported>
121 fgetline <not supported>
122 fgetpos <mutex required> <---
123 fgets <mutex required> <---
124 fpurge <not supported>
125 fputc <mutex required> <---
126 __putc <not supported>
127 fputs <mutex required> <---
128 fread <mutex required> <---
129 freopen <mutex required> <---
130 fscanf <mutex required> <---
131 fseek <mutex required> <---
132 ftell <mutex required> <---
133 fwalk <not supported>
134 fwrite <mutex required> <---
135 getc <macro for fgetc>
136 getchar <mutex required> <---
137 putc <macro for fputc>
138 putchar <mutex required> <---
139 puts <mutex required> <---
141 refill <not supported>
142 rewind <mutex required> <---
143 scanf <mutex required> <---
144 setvbuf <mutex required> <---
145 ungetc <mutex required> <---
146 vfprintf <mutex required> <---
147 vscanf <mutex required> <---
149 1.5 Unlocked buffer access
151 These functions get used in situations where speed is important,
152 and locking isn't necessary, or for use in a section of code that
153 is already locked. For example, a for-loop that makes multiple calls
154 to getc could make an exlicit call to flockfile outside the loop, and
155 then use getc_unlocked within the loop for speed. That way, the lock
156 only needs to be grabbed and released once, rather than for each call.
158 getc_unlocked <required> <---
159 getchar_unlocked <required> <---
160 putc_unlocked <required> <---
161 putchar_unlocked <required> <---
163 1.6 Additional unlocked calls made in glibc
165 These are additional functions (not mentioned by Butenhof) that the
166 glibc library uses for unlocked buffer access. Though not strictly
167 necessary, these may be nice to have in uClibc.
169 fileno_unlocked <desired> <---
170 clearerr_unlocked <desired> <---
171 feof_unlocked <desired> <---
172 ferror_unlocked <desired> <---
173 fputc_unlocked <desired> <---
174 fgetc_unlocked <desired> <---
175 fflush_unlocked <desired> <---
176 fread_unlocked <desired> <---
177 fwrite_unlocked <desired> <---
178 fgets_unlocked <desired> <---
179 fputs_unlocked <desired> <---
181 1.7 Additional unlocked calls made in Proventhreads
183 Proventhreads only provides the four unlocked function calls above.
188 2. Thread-safe functions:
190 There are some functions in the C library standard that are
191 simply not thread-safe and cannot be thread-safe using their
192 current interface. For example, any function that returns a
193 pointer to static data, or requires static context between
194 calls. To resolve this problem, new functions were added to
195 the standard that perform the same basic task, but use a new
196 interface that does not require static data. These functions
197 share their name with the old unsafe functions, but have an
198 "_r" appended to the name. By definition, these functions are
199 reentrant and thread-safe. It is important to note that these
200 functions to do not depend on <pthread.h> and can be used even
201 if threading is not supported.
203 2.1 User and terminal identification:
205 getlogin_r <implemented>
206 ctermid <implemented> (1)
207 ttyname_r <required> <---
209 1. ctermid is a special case. The signature has not changed, but a
210 requirement has been added that its parameter point to a structure
211 of exactly L_ctermid bytes.
213 2.2 Directory searching
215 readdir_r <required> <---
219 strtok_r <implemented>
221 2.4 Time representation
223 asctime_r <implemented>
224 ctime_r <implemented>
225 gmtime_r <implemented>
226 localtime_r <implemented>
228 2.5 Random number generation
230 rand_r <required> <---
232 2.6 Group and user database
234 getgrgid_r <required> <---
235 getgrnam_r <required> <---
236 getpwuid_r <implemented>
237 getpwnam_r <implemented>
239 2.7 Additional thread-safe functions implemented by glibc
241 The following is a list of additional functions implemented by glibc
242 that also provide thread-safe functionality. Most of these functions
243 are not supported by uClibc, so there is no need to implement the
244 thread-safe version. Those that do apply, but have not been
245 implemented yet are highlighted.
247 __fgetpwent_r <not supported>
248 fgetpwent_r <implemented>
249 __ttyname_r <not supported>
250 getttyname_r <not supported>
251 __getmntent_r <not supported>
252 getmntent_r <desired> <---
253 ecvt_r <not supported>
254 fcvt_r <not supported>
255 qecvt_r <not supported>
256 qfcvt_r <not supported>
257 hcreate_r <not supported>
258 hdestroy_r <not supported>
259 hsearch_r <not supported>
260 __getspent_r <not supported>
261 getspent_r <not supported>
262 __getspnam_r <not supported>
263 getspnam_r <not supported>
264 __sgetspent_r <not supported>
265 sgetspent_r <not supported>
266 __fgetspent_r <not supported>
267 fgetspent_r <not supported>
268 __gethostbyaddr_r <not supported>
269 gethostbyaddr_r <desired> <---
270 __gethostbyname2_r <not supported>
271 gethostbyname2_r <not supported>
272 __gethostbyname_r <not supported>
273 gethostbyname_r <desired> <---
274 __gethostent_r <not supported
275 gethostent_r <not supported>
276 __getnetbyaddr_r <not supported>
277 getnetbyaddr_r <desired> <---
278 __getnetent_r <not supported>
279 getnetent_r <desired> <---
280 __getnetbyname_r <not supported>
281 getnetbyname_r <desired> <---
282 __getprotobynumber_r <not supported>
283 getprotobynumber_r <desired> <---
284 __getprotoent_r <not supported>
285 getprotoent_r <desired> <---
286 __getprotobyname_r <not supported>
287 getprotobyname_r <desired> <---
288 __getservbyname_r <not supported>
289 getservbyname_r <desired> <---
290 __getservbyport_r <not supported>
291 getservbyport_r <desired> <---
292 __getservent_r <not supported>
293 getservent_r <desired> <---
294 __getrpcent_r <not supported>
295 getrpcent_r <desired> <---
296 __getrpcbyname_r <not supported>
297 getrpcbyname_r <desired> <---
298 __getrpcbynumber_r <not supported>
299 getrpcbynumber_r <desired> <---
300 ether_aton_r <not supported>
301 ether_ntoa_r <not supported>
302 __getnetgrent_r <not supported>
303 __internal_getnetgrent_r <not supported>
304 getnetgrent_r <not supported>
305 __getaliasent_r <not supported>
306 getaliasent_r <not supported>
307 __getaliasbyname_r <not supported>
308 getaliasbyname_r <not supported>
309 __nscd_getpwnam_r <not supported>
310 __nscd_getpwuid_r <not supported>
311 nscd_getpw_r <not supported>
312 __nscd_getgrgid_r <not supported>
313 __nscd_getgrnam_r <not supported>
314 nscd_getgr_r <not supported>
315 __nscd_gethostbyaddr_r <not supported>
316 __nscd_gethostbyname2_r <not supported>
317 __nscd_gethostbyname_r <not supported>
318 nscd_gethst_r <not supported>
319 __getutent_r <desired> <---
320 getutent_r <desired> <---
321 getutent_r_unknown <not supported>
322 getutid_r_unknown <not supported>
323 getutline_r_unknown <not supported>
324 __getutid_r <not supported>
325 getutid_r <desired> <---
326 __getutline_r <not supported>
327 getutline_r <required> <---
328 getutent_r_file <not supported>
329 getutid_r_file <not supported>
330 getutline_r_file <not supported>
331 internal_getut_r <not supported>
332 getutent_r_daemon <not supported>
333 getutid_r_daemon <not supported>
334 getutline_r_daemon <not supported>
335 __ptsname_r <not supported>
336 ptsname_r <not supported>
339 2.8 Additional thread-safe functions implemented by Proventhreads
341 See description above. This applies only to the C library included
342 in the proventhreads distribution.
344 inet_ntoa_r <desired> <---
345 gethostbyaddr_r <desired> <---
346 gethostbyname_r <desired> <---
347 gethostent_r <not supported>
348 getnetbyaddr_r <desired> <---
349 getnetbyname_r <desired> <---
350 getnetent_r <desired> <---
351 getprotobynumber_r <desired> <---
352 getprotoent_r <desired> <---
353 getprotobyname_r <desired> <---
354 getservbyname_r <desired> <---
355 getservbyport_r <desired> <---
356 getservent_r <desired> <---
359 3. List of functions in uClibc that use static data structures
361 The following is a list of static data structures found in uClibc,
362 and the functions that use them. In most cases, static data is not
363 thread-safe, since multiple threads can access the same data at the
364 same time. This is an attempt to identify all of the static data that
365 is not considered thread-safe. Some of these problems will get
366 resolved by the changes outlines above.
370 static struct crypt_data __crypt_data;
372 crypt <crypt_r implemented>
373 setkey <setkey_r implemented>
374 encrypt <encrypt_r implemented>
376 --------------------------------------------------------------------
380 static unsigned char PADDING[64] <fix desired> <---
382 NOTE: This is okay, but should use the const keyword.
384 --------------------------------------------------------------------
390 inet_ntoa <inet_ntoa_r not implemented> <---
392 --------------------------------------------------------------------
396 static FILE *netf = NULL;
397 static char line[BUFSIZ+1];
398 static struct netent net;
399 static char *net_aliases[MAXALIASES];
401 setnetent <fix required> <---
402 endnetent <fix required> <---
403 getnetent <getnetent_r required> <---
405 NOTE: setnetent and endnetent are not implemented in glibc.
406 Proventhreads uses pthread mutexes to protect this static data.
408 --------------------------------------------------------------------
412 static FILE *protof = NULL;
413 static char line[BUFSIZ+1];
414 static struct protoent proto;
415 static char *proto_aliases[MAXALIASES];
416 static int proto_stayopen;
418 setprotoent <fix required> <---
419 endprotoent <fix required> <---
420 getprotoent <getprotoent_r required> <---
421 getprotobyname <getprotobyname_r required> <---
422 getprotobynumber <getprotobynumber required> <---
424 NOTE: setprotoent and endprotoent are not implemented in glibc.
425 Proventhreads uses pthread mutexes to protect this static data.
427 --------------------------------------------------------------------
431 static FILE *servf = NULL;
432 static char line[BUFSIZ+1];
433 static struct servent serv;
434 static char *serv_aliases[MAXALIASES];
435 static int serv_stayopen;
437 setservent <fix required> <---
438 endservent <fix required> <---
439 getservent <getservent_r required> <---
440 getservbyname <getservbyname_r required> <---
441 getservbyport <getservbyport_r required> <---
443 NOTE: setservent and endservent are not implemented in glibc.
444 Proventhreads uses pthread mutexes to protect this static data.
446 --------------------------------------------------------------------
453 dns_lookup <fix required> <---
455 NOTE: dns_lookup is not implemented by glibc or Proventhreads.
457 static struct hostent h;
458 static char namebuf[256];
459 static struct in_addr in;
460 static struct in_addr *addr_list[2];
462 gethostbyname <gethostbyname_r required> <---
464 static struct hostent h;
465 static char namebuf[256];
466 static struct in_addr in;
467 static struct in_addr *addr_list[2];
469 gethostbyaddr <gethostbyaddr_r required> <---
471 static struct hostent h;
472 static struct in_addr in;
473 static struct in_addr *addr_list[2];
474 static char line[80];
476 read_etc_hosts <fix required> <---
478 NOTE: dns_lookup is not implemented by glibc or Proventhreads.
480 --------------------------------------------------------------------
482 inet/rpc/auth_none.c:
484 static struct auth_ops ops
485 static struct authnone_private
487 authnone_create <fix required> <---
488 authnone_marshal <fix required> <---
490 NOTE: This file makes a lot of use of this static variable and
491 also a global allocated authentication structure. Care should
492 be taken in fixing this to make it thread-safe.
494 --------------------------------------------------------------------
496 inet/rpc/auth_unix.c:
498 static struct auth_ops auth_unix_ops
500 authunix_create <fix required> <---
501 marshal_new_auth <fix required> <---
503 NOTE: This file makes a lot of use of this static variable and
504 also a global allocated authentication structure. Care should
505 be taken in fixing this to make it thread-safe.
507 --------------------------------------------------------------------
509 inet/rpc/bindresvport.c:
513 bindresvport <fix required> <---
515 --------------------------------------------------------------------
517 inet/rpc/clnt_perror.c:
520 static struct rpc_errtab rpc_errlist[]
521 static struct auth_errtab auth_errlist[]
523 NOTE: These static structures all have #if 0 around them, so they
524 do not get compiled in. Hopefully, we don't have to worry about
525 them right now, but prehaps a comment should be added to the code
526 indicating that it is not thread-safe.
528 --------------------------------------------------------------------
532 static struct clntraw_private
533 static struct clnt_ops client_ops
535 clntraw_create <fix required> <---
536 clntraw_call <fix required> <---
537 clntraw_freeres <fix required> <---
539 NOTE: This file makes a lot of use of these static variables and
540 also a global allocated client structure. Care should
541 be taken in fixing this to make it thread-safe.
543 --------------------------------------------------------------------
545 inet/rpc/clnt_simple.c:
547 static struct callrpc_private
549 callrpc <fix required> <---
551 --------------------------------------------------------------------
555 static struct clnt_ops tcp_ops
559 NOTE: This static structure is just a group of function pointers.
560 It could probably be made const, but this might affect the function
561 signature. This should be investigated further.
563 --------------------------------------------------------------------
567 static struct clnt_ops udp_ops
571 NOTE: This static structure is just a group of function pointers.
572 It could probably be made const, but this might affect the function
573 signature. This should be investigated further.
575 --------------------------------------------------------------------
577 inet/rpc/getrpcent.c:
579 static char RPCDB[] <fix desired> <---
581 NOTE: This is okay, but should use the const keyword.
583 --------------------------------------------------------------------
585 inet/rpc/pmap_clnt.c:
587 static struct timeval timeout <fix desired> <---
588 static struct timeval tottimeout <fix desired> <---
590 NOTE: These are okay, but should use the const keyword.
592 --------------------------------------------------------------------
594 inet/rpc/pmap_getport.c:
596 static struct timeval timeout <fix desired> <---
597 static struct timeval tottimeout <fix desired> <---
599 NOTE: These are okay, but should use the const keyword.
601 --------------------------------------------------------------------
605 static struct timeval timeout <fix desired> <---
607 NOTE: This is okay, but should use the const keyword.
609 --------------------------------------------------------------------
611 inet/rpc/rpc_dtablesize.c:
615 _rpc_dtablesize <fix required> <---
617 --------------------------------------------------------------------
621 static struct xdr_discrim reply_dscrm[3] <fix desired> <---
623 NOTE: This is okay, but should use the const keyword.
625 --------------------------------------------------------------------
629 static SVCXPRT **xports;
630 static SVCXPRT *xports[NOFILE];
631 static struct svc_callout
633 xprt_register <fix required> <---
634 xprt_unregister <fix required> <---
635 svc_getreqset <fix required> <---
636 svc_register <fix required> <---
637 svc_unregister <fix required> <---
638 svc_callout <fix required> <---
640 NOTE: This is intricate code, and care should be taken when making
643 --------------------------------------------------------------------
647 static struct svcauthsw <fix desired> <---
649 NOTE: This is okay, but should use the const keyword.
651 --------------------------------------------------------------------
655 static struct svcraw_private
656 static struct xp_ops server_ops
658 svcraw_create <fix required> <---
659 svcraw_recv <fix required> <---
660 svcraw_reply <fix required> <---
661 svcraw_getargs <fix required> <---
662 svcraw_freeargs <fix required> <---
664 NOTE: This is intricate code, and care should be taken when making
667 --------------------------------------------------------------------
669 inet/rpc/svc_simple.c:
671 static struct proglst
672 static SVCXPRT *transp;
674 registerrpc <fix required> <---
675 universal <fix required> <---
677 NOTE: This is intricate code, and care should be taken when making
680 --------------------------------------------------------------------
684 static struct xp_ops svctcp_op
685 static struct xp_ops svctcp_rendezvous_op
687 svctcp_create <fix required> <---
688 makefd_xprt <fix required> <---
690 NOTE: This static structure is just a group of function pointers.
691 It could probably be made const, but this might affect the function
692 signature. This should be investigated further.
694 static struct timeval wait_per_try
696 readtcp <fix required> <---
698 NOTE: This looks like a bug. This static timeout value is passed
699 by reference to a select() call. According to the linux man page
702 "On Linux, timeout is modified to reflect the amount of
703 time not slept; most other implementations do not do this.
704 This causes problems both when Linux code which reads
705 timeout is ported to other operating systems, and when
706 code is ported to Linux that reuses a struct timeval for
707 multiple selects in a loop without reinitializing it.
708 Consider timeout to be undefined after select returns."
710 Unless the implementation of select is different than that of Linux,
711 this needs to be fixed!
713 --------------------------------------------------------------------
717 static struct xp_ops svcudp_op <fix desired> (1)
721 1: This static structure is just a group of function pointers.
722 It could probably be made const, but this might affect the function
723 signature. This should be investigated further.
725 --------------------------------------------------------------------
729 static char xdr_zero[BYTES_PER_XDR_UNIT] <fix desired> <---
731 NOTE: This is okay, but should use the const keyword.
733 static u_long crud[BYTES_PER_XDR_UNIT]
735 NOTE: This looks like it doesn't matter what's in this array.
737 --------------------------------------------------------------------
739 inet/rpc/xdr_float.c:
741 static struct sgl_limits <fix desired> <---
742 static struct dbl_limits <fix desired> <---
744 NOTE: These are okay, but should use the const keyword.
746 --------------------------------------------------------------------
750 static struct xdr_ops xdrmem_ops <fix desired> (1)
754 1: This static structure is just a group of function pointers.
755 It could probably be made const, but this might affect the function
756 signature. This should be investigated further.
758 --------------------------------------------------------------------
762 static struct xdr_ops xdrrec_ops <fix desired> (1)
766 1: This static structure is just a group of function pointers.
767 It could probably be made const, but this might affect the function
768 signature. This should be investigated further.
770 --------------------------------------------------------------------
772 inet/rpc/xdr_stdio.c:
774 static struct xdr_ops xdrstdio_ops <fix desired> (1)
778 1: This static structure is just a group of function pointers.
779 It could probably be made const, but this might affect the function
780 signature. This should be investigated further.
782 --------------------------------------------------------------------
784 ld.so-1/d-link/boot1.c:
786 static char *_dl_malloc_addr
787 static char *_dl_mmap_zero
788 static char *_dl_not_lazy
789 static char *_dl_warn
790 static char *_dl_trace_loaded_objects
792 _dl_boot <fix required> <---
793 _dl_malloc <fix required> <---
794 _dl_fixup <fix required> <---
796 These are all part of the shared library loader, and are not
797 used by applications directly. Therefore, fixing these is not
798 a high priority item.
800 --------------------------------------------------------------------
802 ld.so-1/d-link/readelflib1.c:
804 static caddr_t _dl_cache_addr
805 static size_t _dl_cache_size
807 _dl_map_cache <fix required> <---
808 _dl_unmap_cache <fix required> <---
809 _dl_load_shared_library <fix required> <---
811 These are all part of the shared library loader, and are not
812 used by applications directly. Therefore, fixing these is not
813 a high priority item.
815 --------------------------------------------------------------------
817 ld.so-1/d-link/string.h:
819 static char local[22]
821 _dl_simple_ltoa <fix required> <---
822 _dl_simple_ltoahex <fix required> <---
824 These are all part of the shared library loader, and are not
825 used by applications directly. Therefore, fixing these is not
826 a high priority item.
828 --------------------------------------------------------------------
830 ld.so-1/d-link/arm/elfinterp.c:
832 static char *_dl_reltypes[] <fix desired> <---
834 NOTE: This is okay, but should use the const keyword.
836 --------------------------------------------------------------------
838 ld.so-1/d-link/i386/elfinterp.c:
840 static char *_dl_reltypes[] <fix desired> <---
842 NOTE: This is okay, but should use the const keyword.
844 These are all part of the shared library loader, and are not
845 used by applications directly. Therefore, fixing these is not
846 a high priority item.
848 --------------------------------------------------------------------
850 ld.so-1/d-link/m68k/elfinterp.c:
852 static char *_dl_reltypes[] <fix desired> <---
854 NOTE: This is okay, but should use the const keyword.
856 These are all part of the shared library loader, and are not
857 used by applications directly. Therefore, fixing these is not
858 a high priority item.
860 --------------------------------------------------------------------
862 ld.so-1/d-link/sparc/elfinterp.c:
864 static char *_dl_reltypes[] <fix desired> <---
866 NOTE: This is okay, but should use the const keyword.
868 These are all part of the shared library loader, and are not
869 used by applications directly. Therefore, fixing these is not
870 a high priority item.
872 --------------------------------------------------------------------
874 ld.so-1/libdl/dlib.c:
878 _dlopen <fix required> <---
880 static int __attribute__ ((unused)) foobar1 <fix required?> (1)
882 NOTE: The comment for this says it all: "This is a real hack." ;-)
885 static char *type[] <fix desired> <---
887 NOTE: This is okay, but should use the const keyword.
889 These are all part of the shared library loader, and are not
890 used by applications directly. Therefore, fixing these is not
891 a high priority item.
893 --------------------------------------------------------------------
895 ld.so-1/util/ldconfig.c:
897 static header_t magic <fix desired> <---
899 NOTE: This is okay, but should use the const keyword.
901 static liblist_t *lib_head
903 cache_dolib <fix required> <---
904 cache_write <fix required> <---
906 This is not actually part of the C library, and is not built by
907 default, so fixing these is not a high priority item.
909 --------------------------------------------------------------------
911 misc/internals/tempname.c:
913 static uint64_t value;
915 __gen_tempname <fix required> <---
917 --------------------------------------------------------------------
919 misc/locale/locale.c:
921 static char C_LOCALE_NAME[]="C"; <fix desired> <---
923 NOTE: This is okay, but should use the const keyword.
925 static struct SAV_LOADED_LOCALE sav_loaded_locale [1]
926 static struct SAV_LOADED_LOCALE * old_locale
928 setlocale <fix required> <---
930 NOTE: Can different threads use different locales? I don't see
933 --------------------------------------------------------------------
935 misc/locale/localeconv.c:
937 static struct lconv result;
939 localeconv <fix required> <---
941 NOTE: This function returns a pointer to a static data structure.
943 static char *blank = ""; <fix desired> <---
944 static char *decimal = "."; <fix desired> <---
946 NOTE: These are okay, but should use the const keyword.
948 --------------------------------------------------------------------
950 misc/mntent/mntent.c:
952 static char buff[MNTMAXSTR];
953 static struct mntent mnt;
955 getmntent <getmntent_r required> <---
957 --------------------------------------------------------------------
961 static char re_syntax_table[CHAR_SET_SIZE];
964 init_syntax_table <fix required> <---
968 <several functions> <fix required> <---
970 NOTE: This is used to turn on debugging, and is used in several
971 functions. It will need to be fixed if you want differing debug
974 static char reg_unset_dummy;
976 <REG_UNSET...> <fix required> <---
978 static fail_stack_type fail_stack;
980 regex_compile <fix required> <---
981 <FREE_VARIABLES> <fix required> <---
982 <FAIL_STACK_EMPTY> <fix required> <---
983 <FAIL_STACK_PTR_EMPTY> <fix required> <---
984 <FAIL_STACK_FULL> <fix required> <---
985 <INIT_FAIL_STACK> <fix required> <---
986 <RESET_FAIL_STACK> <fix required> <---
987 <DOUBLE_FAIL_STACK> <fix required> <---
988 <PUSH_FAILURE_POINTER> <fix required> <---
989 <PUSH_FAILURE_INT> <fix required> <---
990 <PUSH_FAILURE_ELT> <fix required> <---
991 <POP_FAILURE_POINTER> <fix required> <---
992 <POP_FAILURE_INT> <fix required> <---
993 <POP_FAILURE_ELT> <fix required> <---
994 <REMAINING_AVAIL_SLOTS> <fix required> <---
996 static int regs_allocated_size;
998 regs_grow_registers <fix required> <---
1000 static register_info_type *reg_info;
1001 static register_info_type *reg_info_dummy;
1002 static unsigned failure_id;
1003 static struct re_pattern_buffer re_comp_buf;
1005 <too many to list> <fix required> <---
1007 NOTE: This is just a NASTY file for static variables. A lot of
1008 work needs to be done here to clean this up. But I'm not even
1009 sure if it matters. This code is taken directly from glibc.
1011 This code is also very large (adds over 30k to the C library
1012 all by itself). This file needs a complete rewrite.
1014 --------------------------------------------------------------------
1016 misc/syslog/syslog.c:
1018 static pthread_once__t _once_block = pthread_once_init;
1019 static pthread_mutex_t _syslog_mutex;
1021 NOTE: I think these are okay. ;-)
1023 static int LogFile = -1;
1024 static int connected;
1025 static int LogStat = 0;
1026 static int LogFacility = LOG_USER;
1027 static int LogMask = 0xff;
1028 static char truncate_msg[12]
1029 static struct sockaddr SyslogAddr;
1031 NOTE: These are already protected.
1033 --------------------------------------------------------------------
1035 misc/time/asctime.c:
1037 static char timebuf[26];
1039 asctime <asctime_r implemented>
1041 --------------------------------------------------------------------
1045 static char cbuf[26];
1047 ctime <ctime_r implemented>
1049 --------------------------------------------------------------------
1053 static struct tm tmb;
1055 gmtime <gmtime_r implemented>
1057 --------------------------------------------------------------------
1059 misc/time/localtime.c:
1061 static struct tm tmb;
1063 localtime <localtime_r implemented>
1065 --------------------------------------------------------------------
1069 static tz_rule tz_rules[2];
1071 tzset <fix required> <---
1073 static time_t localtime_offset;
1075 mktime <fix required> <---
1077 --------------------------------------------------------------------
1079 misc/time/tm_conv.c:
1081 static int moffset[] <fix desired> <---
1083 NOTE: This is okay, but should use the const keyword.
1085 --------------------------------------------------------------------
1089 static int ut_fd = -1;
1091 setutent <fix required> <---
1092 endutent <fix required> <---
1093 getutent <fix required> <---
1094 getutid <fix required> <---
1095 getutline <fix required> <---
1096 pututline <fix required> <---
1097 utmpname <fix required> <---
1099 static struct utmp utmp;
1101 __getutent <fix required> <---
1103 --------------------------------------------------------------------
1105 pwd_grp/__getgrent.c:
1107 static char line_buff[GR_MAX_LINE_LEN];
1108 static char *members[GR_MAX_MEMBERS];
1109 static char *line_buff = NULL;
1110 static char **members = NULL;
1111 static struct group group;
1113 __getgrent <fix required> <---
1115 --------------------------------------------------------------------
1117 pwd_grp/fgetpwent.c:
1119 static char line_buff[PWD_BUFFER_SIZE];
1120 static struct passwd pwd;
1122 fgetpwent <fgetpwent_r implemented>
1124 --------------------------------------------------------------------
1128 static char line_buff[PWD_BUFFER_SIZE];
1129 static struct passwd pwd;
1131 getpwnam <getpwnam_r implemented>
1133 --------------------------------------------------------------------
1137 static char line_buff[PWD_BUFFER_SIZE];
1138 static struct passwd pwd;
1140 getpwuid <getpwuid_r implemented>
1142 --------------------------------------------------------------------
1146 static int grp_fd = -1;
1148 setgrent <fix required> <---
1149 endgrent <fix required> <---
1150 getgrent <fix required> <---
1152 --------------------------------------------------------------------
1156 static int pw_fd = -1;
1158 setpwent <fix required> <---
1159 endpwent <fix required> <---
1160 getpwent_r <fix required> <---
1162 NOTE: Yeah, this looks weird, but getpwent_r isn't completely
1165 static char line_buff[PWD_BUFFER_SIZE];
1166 static struct passwd pwd;
1168 getpwent <getpwent_r implemented> <---
1170 --------------------------------------------------------------------
1174 static char tmpnam_buffer[L_tmpnam];
1176 tmpnam <tmpnam_r implemented>
1178 --------------------------------------------------------------------
1182 static vfuncp __atexit_table[__UCLIBC_MAX_ATEXIT];
1183 static int __atexit_count = 0;
1185 atexit_handler <fix required> <---
1186 atexit <fix required> <---
1188 --------------------------------------------------------------------
1192 static int _bsearch;
1194 bsearch <fix required> <---
1196 --------------------------------------------------------------------
1200 static char **mall_env = 0;
1201 static int extras = 0;
1203 putenv <fix required> <---
1205 --------------------------------------------------------------------
1209 static long int seed1 = 1;
1210 static long int seed2 = 1;
1211 static long int seed3 = 1;
1213 random <fix required?> (1)
1214 srandom <fix required?> (1)
1216 1: I'm not sure if it matters if these are static, since they
1217 are random number seeds. Who cares if more than one thread changes
1220 --------------------------------------------------------------------
1224 static pthread_once__t _once_block = pthread_once_init; (1)
1225 static pthread_mutex_t _setenv_mutex; (1)
1226 static char **last_environ = NULL; (1)
1228 1: Obviously, nothing to do here. (Unless I change the way we
1231 --------------------------------------------------------------------
1233 stdlib/malloc/avlmacro.h
1235 static objname *__Avl_##objname##pr##_new_node;
1237 Avl_Tree_no_replace <fix required> <---
1239 NOTE: This will take a bit of study to figure out if it needs fixing.
1241 --------------------------------------------------------------------
1243 stdlib/malloc/malloc.c:
1245 //static mutex_t malloc_lock = MUTEX_INITIALIZER; <---
1247 NOTE: Basically, thread support in malloc is broken and must be
1248 fixed. It looks like the infrastructure is there, but more
1249 investigation is required.
1251 --------------------------------------------------------------------
1253 stdlib/malloc-930716/malloc.c:
1255 static int heapsize;
1256 static int initialized;
1257 static size_t pagesize;
1259 inititalize <fix required> <---
1260 morecore <fix required> <---
1261 malloc <fix required> <---
1263 --------------------------------------------------------------------
1265 stdlib/malloc-930716/valloc.c:
1267 static size_t pagesize;
1269 valloc <fix required> <---
1271 --------------------------------------------------------------------
1275 static char *args[16];
1276 static char cfgbuf[128];
1278 cfgread <fix required> <---
1280 --------------------------------------------------------------------
1284 static char retbuf[48];
1285 static char retbuf[33];
1287 strerror <fix required> <---
1288 main <fix required> <---
1290 --------------------------------------------------------------------
1294 static char retbuf[28];
1296 strsignal <fix required> <---
1297 main <fix required> <---
1299 --------------------------------------------------------------------
1303 static char *save = 0;
1305 strtok <strtok_r implemented> <---
1307 --------------------------------------------------------------------
1309 sysdeps/linux/common/kernel_version.c:
1311 static int __linux_kernel_version = -1;
1313 __get_linux_kernel_version <fix required> (1)
1315 1: This static value never actually gets updated! This a bug.
1317 --------------------------------------------------------------------
1319 sysdeps/linux/i386/bits/huge_val.h:
1321 static __huge_val_t __huge_val <fix desired> <---
1322 static __huge_valf_t __huge_valf <fix desired> <---
1323 static __huge_vall_t __huge_vall <fix desired> <---
1325 NOTE: These are okay, but should use the const keyword.
1327 --------------------------------------------------------------------
1329 sysdeps/linux/i386/bits/nan.h:
1331 static union { ... } __nan_union <fix desired> <---
1333 NOTE: This is okay, but should use the const keyword.
1335 --------------------------------------------------------------------
1337 sysdeps/linux/m68k/bits/huge_val.h:
1339 static union { ... } __huge_val <fix desired> <---
1340 static union { ... } __huge_valf <fix desired> <---
1341 static union { ... } __huge_vall <fix desired> <---
1343 NOTE: These are okay, but should use the const keyword.
1345 --------------------------------------------------------------------
1347 sysdeps/linux/m68k/bits/nan.h:
1349 static union { ... } __nan_union <fix desired> <---
1351 NOTE: This is okay, but should use the const keyword.
1353 --------------------------------------------------------------------
1355 sysdeps/linux/sh/bits/huge_val.h:
1357 static __huge_val_t __huge_val <fix desired> <---
1358 static __huge_valf_t __huge_valf <fix desired> <---
1360 NOTE: These are okay, but should use the const keyword.
1362 --------------------------------------------------------------------
1364 sysdeps/linux/sh/bits/nan.h:
1366 static union { ... } __nan_union <fix desired> <---
1368 NOTE: This is okay, but should use the const keyword.
1370 --------------------------------------------------------------------
1372 sysdeps/linux/sparc/bits/huge_val.h:
1374 static __huge_val_t __huge_val <fix desired> <---
1375 static __huge_valf_t __huge_valf <fix desired> <---
1377 NOTE: These are okay, but should use the const keyword.
1379 --------------------------------------------------------------------
1381 sysdeps/linux/sparc/bits/nan.h:
1383 static union { ... } __nan_union <fix desired> <---
1385 NOTE: This is okay, but should use the const keyword.
1387 --------------------------------------------------------------------
1391 static int tiocgsid_does_not_work;
1393 tcgestsid <fix required> <---
1395 --------------------------------------------------------------------
1399 static char dev[] = "/dev";
1401 ttyname <fix desired> <---
1403 NOTE: This is okay, but should use the const keyword.
1405 static char name[NAME_MAX];
1407 ttyname <ttyname_r required> <---
1409 --------------------------------------------------------------------
1415 error_msg <fix required> <---
1416 done_testing <fix required> <---
1417 init_testsuite <fix required> <---
1419 --------------------------------------------------------------------
1423 static char *path_buf;
1424 static int path_size;
1425 static dev_t root_dev;
1426 static ino_t root_ino;
1427 static struct stat st;
1429 getswd <fix required> <---
1430 recurser <fix required> <---
1431 search_dir <fix required> <---
1433 --------------------------------------------------------------------
1439 getopt <fix required> <---
1441 --------------------------------------------------------------------
1445 static char buf[PWD_BUFFER_SIZE];
1447 getpass <fix required> <---
1449 NOTE: This function returns a pointer to a static data structure.
1450 This seems like it requires an _r version of this function. Glibc
1451 does the same thing. Oops! So much for thread-safe glibc!
1453 --------------------------------------------------------------------
1455 unistd/gnu_getopt.c:
1457 static char *nextchar;
1458 static enum ordering;
1459 static int first_nonopt;
1460 static int last_nonopt;
1462 _getopt_initialize <fix required> <---
1463 _getopt_internal <fix required> <---
1464 exchange <fix required> <---
1466 static struct option long_options[] <fix desired> <---
1468 NOTE: This is okay, but should use the const keyword.
1470 --------------------------------------------------------------------
1474 static long int ret_vals[_UCLIBC_SYSCONF_NUM_VALID_ARGS];
1476 find_or_add_in_table <fix required?> <---
1477 main <fix required?> <---
1479 NOTE: I'm not sure if this needs to be multi-threaded or not.
1481 --------------------------------------------------------------------
1483 unistd/sysconf_src.c:
1485 static long int ret_vals[_UCLIBC_SYSCONF_NUM_VALID_ARGS];
1487 find_or_add_in_table <fix required?> <---
1488 main <fix required?> <---
1490 NOTE: I'm not sure if this needs to be multi-threaded or not.
1492 --------------------------------------------------------------------
1494 unistd/sysconf_i386.c:
1496 static long int ret_vals[_UCLIBC_SYSCONF_NUM_VALID_ARGS];
1498 find_or_add_in_table <fix required?> <---
1499 main <fix required?> <---
1501 NOTE: I'm not sure if this needs to be multi-threaded or not.
1503 --------------------------------------------------------------------
1506 4. List of functions that use global variables
1508 The following is a list of functions that make use of global
1509 variables. Since multiple threads can access the same global
1510 variable at the same time, access should be considered unsafe.
1511 This is an attempt to identify all the areas where global
1512 variables are used. This does not necessarily mean that each
1513 of these is unsafe. It just means that there is a potential
1514 for them to be unsafe. If this code never runs in more than
1515 one thread, then there's no problem. More ivestigation will be
1516 required to determine if changes are really required.
1520 __environ (misc/internals/__uClibc_main.c)
1524 __uClibc_main <fix required?> (1)
1526 1: This should only get executed once, so it is probably fine.
1530 getenv <fix required> <---
1534 putenv <fix required> <---
1538 setenv <fix required> <---
1539 unsetenv <fix required> <---
1541 test/args/arg_test.c:
1543 main <fix required> <---
1547 execl <fix required> <---
1551 execlp <fix required> <---
1555 execv <fix required> <---
1559 execvep <fix required> <---
1561 --------------------------------------------------------------------
1565 __uClibc_cleanup (misc/internals/__uClibc_main.c)
1569 abort <fix required> <---
1573 atexit_handler <fix required> <---
1574 atexit <fix required> <---
1575 exit <fix required> <---
1577 NOTE: Not sure if multiple threads can be in this code or not.
1579 --------------------------------------------------------------------
1583 environ (misc/internals/__uClibc_main.c)
1585 NOTE: This is a weak alias for __environ, but it doesn't ever get
1586 used in the uClibc library.
1588 --------------------------------------------------------------------
1592 timezone (misc/time/tm_conv.c)
1594 misc/time/tm_conv.c:
1596 __tm_conv <fix required> <---
1598 --------------------------------------------------------------------
1602 re_max_failures (misc/regex/regex.c)
1606 DOUBLE_FAIL_STACK <fix required> <---
1607 regex_compile <fix required> <---
1609 --------------------------------------------------------------------
1613 re_syntax_options (misc/regex/regex.c)
1617 re_set_syntax <fix required> <---
1618 re_compile_pattern <fix required> <---
1619 re_comp <fix required> <---
1621 --------------------------------------------------------------------
1625 __IO_list (stdio/stdio.c)
1629 fflush <fix required> <---
1630 __fopen <fix required> <---
1631 fclose <fix required> <---
1633 --------------------------------------------------------------------
1637 _fixed_buffers (stdio/stdio.c)
1641 _alloc_stdio_buffer <fix required> <---
1642 _free_stdio_buffer_of_file <fix required> <---
1643 __init_stdio <fix required> <---
1645 --------------------------------------------------------------------
1649 _free_buffer_index (stdio/stdio.c)
1653 _alloc_stdio_buffer <fix required> <---
1654 _free_stdio_buffer_of_file <fix required> <---
1655 __init_stdio <fix required> <---
1657 --------------------------------------------------------------------
1661 _free_file_list (stdio/stdio.c)
1665 __init_stdio <fix required> <---
1666 _alloc_stdio_stream <fix required> <---
1667 _free_stdio_stream <fix required> <---
1669 --------------------------------------------------------------------
1673 _stderr (stdio/stdio.c)
1675 ld.so-1/util/ldconfig.c:
1677 warn <fix required> <---
1678 error <fix required> <---
1679 usage <fix required> <---
1683 warn <fix required> <---
1684 error <fix required> <---
1685 is_bin <fix required> <---
1686 main <fix required> <---
1688 misc/locale/locale.c:
1690 setlocale <fix required> <---
1694 printchar <fix required> <---
1698 perror <fix required> <---
1700 stdlib/malloc/alloc.c:
1702 calloc_dbg <fix required> <---
1703 malloc_dbg <fix required> <---
1704 free_dbg <fix required> <---
1706 stdlib/malloc/malloc.c:
1708 __hunk_alloc <fix required?> (1)
1709 __malloc_init <fix required?> (1)
1710 malloc <fix required?> (1)
1712 1: These are commented out with C++ style comments.
1714 stdlib/malloc-simple/alloc.c:
1716 calloc_dbg <fix required> <---
1717 malloc_dbg <fix required> <---
1718 free_dbg <fix required> <---
1722 psignal <fix required> <---
1724 test/args/arg_test.c:
1726 main <fix required> <---
1728 test/assert/assert.c:
1730 main <fix required> <---
1734 Err <fix required> <---
1738 getpass <fix required> <---
1740 unistd/gnu_getopt.c:
1742 _getopt_internal <fix required> <---
1746 main <fix required> <---
1748 unistd/sysconf_src.c:
1750 main <fix required> <---
1752 unistd/sysconf_i386.c:
1754 main <fix required> <---
1756 --------------------------------------------------------------------
1760 _stdin (stdio/stdio.c)
1764 getchar <fix required> <---
1766 include/bits/stdio.h:
1768 getchar <fix required> <---
1769 getchar_unlocked <fix required> <---
1773 scanf <fix required> <---
1774 vscanf <fix required> <---
1778 gets <fix required> <---
1779 getchar <fix required> <---
1781 sysdeps/linux/i386/bits/stdio.h:
1783 getchar <fix required> <---
1784 getchar_unlocked <fix required> <---
1786 sysdeps/linux/m68k/bits/stdio.h:
1788 getchar <fix required> <---
1789 getchar_unlocked <fix required> <---
1791 sysdeps/linux/sh/bits/stdio.h:
1793 getchar <fix required> <---
1794 getchar_unlocked <fix required> <---
1796 sysdeps/linux/sparc/bits/stdio.h:
1798 getchar <fix required> <---
1799 getchar_unlocked <fix required> <---
1803 getpass <fix required> <---
1805 --------------------------------------------------------------------
1809 _stdio_streams (stdio/stdio.c)
1813 __init_stdio <fix required> <---
1814 _free_stdio_stream <fix required> <---
1816 --------------------------------------------------------------------
1820 _stdout (stdio/stdio.c)
1824 putchar <fix required> <---
1826 include/bits/stdio.h:
1828 vprintf <fix required> <---
1829 putchar <fix required> <---
1830 putchar_unlocked <fix required> <---
1832 ld.so-1/util/ldconfig.c:
1834 warn <fix required> <---
1835 error <fix required> <---
1839 warn <fix required> <---
1840 error <fix required> <---
1841 main <fix required> <---
1845 printf <fix required> <---
1846 vprintf <fix required> <---
1850 puts <fix required> <---
1851 _uClibc_fread <fix required> <---
1852 putchar <fix required> <---
1854 sysdeps/linux/i386/bits/stdio.h:
1856 vprintf <fix required> <---
1857 putchar <fix required> <---
1858 putchar_unlocked <fix required> <---
1860 sysdeps/linux/m68k/bits/stdio.h:
1862 vprintf <fix required> <---
1863 putchar <fix required> <---
1864 putchar_unlocked <fix required> <---
1866 sysdeps/linux/sh/bits/stdio.h:
1868 vprintf <fix required> <---
1869 putchar <fix required> <---
1870 putchar_unlocked <fix required> <---
1872 sysdeps/linux/sparc/bits/stdio.h:
1874 vprintf <fix required> <---
1875 putchar <fix required> <---
1876 putchar_unlocked <fix required> <---
1878 test/pwd_grp/test_grp.c:
1880 main <fix required> <---
1882 test/pwd_grp/test_pwd.c:
1884 main <fix required> <---
1886 --------------------------------------------------------------------
1890 dns_caught_signal (inet/resolv.c)
1894 dns_catch_signal <fix required> <---
1895 dns_lookup <fix required> <---
1897 --------------------------------------------------------------------
1901 nameserver (inet/resolv.c)
1902 nameservers (inet/resolv.c)
1906 open_nameservers <fix required> <---
1907 close_nameservers <fix required> <---
1908 resolve_name <fix required> <---
1909 gethostbyname <fix required> <---
1910 res_query <fix required> <---
1911 gethostbyaddr <fix required> <---
1913 --------------------------------------------------------------------
1917 searchdomain (inet/resolv.c)
1918 searchdomains (inet/resolv.c)
1922 dns_lookup <fix required> <---
1924 --------------------------------------------------------------------
1928 _net_stayopen (inet/getnetent.c)
1932 getnetbyaddr <fix required> <---
1936 getnetbyname <fix required> <---
1940 setnetent <fix required> <---
1941 endnetent <fix required> <---
1943 --------------------------------------------------------------------
1947 rpcdata (inet/rpc/getrpcent.c)
1949 inet/rpc/getrpcent.c:
1951 _rpcdata <fix required> <---
1953 --------------------------------------------------------------------
1957 _null_auth (inet/rpc/rpc_commondata.c) <fix desired> <---
1959 NOTE: _null_auth is never actually initialized. It never gets written,
1960 only read. So it should be thread safe. But it should be declared
1961 as a const if that is the case. It should also be initialized.
1963 inet/rpc/auth_none.c:
1967 inet/rpc/auth_unix.c:
1971 inet/rpc/clnt_raw.c:
1975 inet/rpc/clnt_tcp.c:
1979 inet/rpc/clnt_udp.c:
1983 inet/rpc/pmap_rmt.c:
1987 inet/rpc/svc_auth.c:
1995 --------------------------------------------------------------------
1999 rpc_createerr (inet/rpc/rpc_commondata.c)
2001 inet/rpc/clnt_generic.c:
2003 clnt_create <fix required> <---
2005 inet/rpc/clnt_perror.c:
2007 clnt_spcreateerror <fix desired?> <---
2009 NOTE: This piece of code has an "#if 0" around it.
2011 inet/rpc/clnt_simple.c:
2013 callrpc <fix required> <---
2015 inet/rpc/clnt_tcp.c:
2017 clnttcp_create <fix required> <---
2019 inet/rpc/clnt_udp.c:
2021 clntudp_bufcreate <fix required> <---
2023 inet/rpc/pmap_getport.c:
2025 pmap_getport <fix required> <---
2027 --------------------------------------------------------------------
2031 svc_fdset (inet/rpc/rpc_commondata.c)
2035 xprt_register <fix required> <---
2036 xprt_unregister <fix required> <---
2037 svc_getreq <fix required> <---
2041 svc_run <fix required> <---
2043 NOTE: Be careful to also fix the uses of the "svc_fds" #define.
2045 --------------------------------------------------------------------
2049 pl (inet/rpc/svc_simple.c)
2051 registerrpc <fix required> <---
2053 NOTE: proglst is set up to point at pl, so it needs fixing as well.
2054 (See proglst earlier in this document.)
2056 --------------------------------------------------------------------
2060 _sigintr (signal/signal.c)
2064 __bsd_signal <fix required> <---
2068 siginterrupt <fix required> <---
2070 --------------------------------------------------------------------
2074 __Avl_Block_tfree_mem_tree (stdlib/malloc/malloc.c)
2076 stdlib/malloc/malloc.c:
2078 __free_mem_del_block <fix required> <---
2079 bl_alloc <fix required> <---
2080 __malloc_init <fix required> <---
2082 NOTE: This code is very tricky stuff.
2084 --------------------------------------------------------------------
2088 __Avl_Block_tptrs_tree (stdlib/malloc/malloc.c)
2090 stdlib/malloc/malloc.c:
2092 __bl_free <fix required> <---
2093 __malloc_init <fix required> <---
2094 free <fix required> <---
2095 _realloc_no_move <fix required> <---
2096 realloc <fix required> <---
2098 --------------------------------------------------------------------
2102 __bl_last (stdlib/malloc/malloc.c)
2104 stdlib/malloc/malloc.c:
2106 COMBINE_BLOCKS <fix required> <---
2107 SPLIT_BLOCK <fix required> <---
2108 bl_mapnew <fix required> <---
2109 bl_alloc <fix required> <---
2110 __malloc_init <fix required> <---
2112 --------------------------------------------------------------------
2116 __free_h (stdlib/malloc/malloc.c)
2118 stdlib/malloc/malloc.c:
2120 __hunk_alloc <fix required> <---
2121 __hunk_free <fix required> <---
2122 __malloc_init <fix required> <---
2124 --------------------------------------------------------------------
2128 __malloc_initialized (stdlib/malloc/malloc.c)
2130 stdlib/malloc/malloc.c:
2132 __malloc_init <fix required> <---
2133 malloc <fix required> <---
2134 free <fix required> <---
2135 _realloc_no_move <fix required> <---
2137 --------------------------------------------------------------------
2141 __total_h (stdlib/malloc/malloc.c)
2143 stdlib/malloc/malloc.c:
2145 __hunk_alloc <fix required> <---
2146 __malloc_init <fix required> <---
2148 --------------------------------------------------------------------
2152 errno (sysdeps/linux/common/errno.c)
2154 sysdeps/linux/common/errno.c:
2156 __errno_location <fix required> <---
2158 NOTE: Obviously, errno gets used all over the place. I won't list
2161 --------------------------------------------------------------------
2165 ___brk_addr (sysdeps/linux/i386/__init_brk.c)
2167 sysdeps/linux/i386/__init_brk.c:
2169 __init_brk <fix required> <---
2171 sysdeps/linux/i386/brk.c:
2173 brk <fix required> <---
2175 sysdeps/linux/i386/sbrk.c:
2177 sbrk <fix required> <---
2179 --------------------------------------------------------------------
2183 optarg (unistd/getopt_vars.c)
2185 extra/locale/gen_ctype_from_glibc.c:
2187 main <fix required?> (1)
2189 ld.so-1/util/ldconfig.c:
2191 main <fix required?> (1)
2195 getopt <fix required> <---
2197 unistd/gnu_getopt.c:
2199 _getopt_internal <fix required> <---
2200 main <fix required?> (1)
2202 1: Probably not required unless this program is run on multiple
2205 --------------------------------------------------------------------
2209 opterr (unistd/getopt_vars.c)
2211 ld.so-1/util/ldconfig.c:
2213 main <fix required?> (1)
2217 Err <fix required> <---
2218 getopt <fix required> <---
2220 unistd/gnu_getopt.c:
2222 _getopt_internal <fix required> <---
2224 1: Probably not required unless this program is run on multiple
2227 --------------------------------------------------------------------
2231 optind (unistd/getopt_vars.c)
2233 extra/locale/gen_ctype_from_glibc.c:
2235 main <fix required?> (1)
2237 ld.so-1/util/ldconfig.c:
2239 main <fix required?> (1)
2243 main <fix required?> (1)
2247 Err <fix required> <---
2248 getopt <fix required> <---
2250 unistd/gnu_getopt.c:
2252 exchange <fix required> <---
2253 _getopt_initialize <fix required> <---
2254 _getopt_internal <fix required> <---
2255 main <fix required?> (1)
2256 main (2nd one) <fix required?> (1)
2258 1: Probably not required unless this program is run on multiple
2261 --------------------------------------------------------------------
2265 optopt (unistd/getopt_vars.c)
2269 Err <fix required> <---
2270 getopt <fix required> <---
2272 unistd/gnu_getopt.c:
2274 _getopt_internal <fix required> <---