[Previous]
[Contents]
[Next]

How's It Safe To Use These Functions?

This chapter summarizes whether or not it's safe to use the C Library functions:


Note: The functions designated as threadsafe are safe only if you create threads with _beginthread(), not tfork().

Use these links to find a function quickly:

A B C D E F G H I J K L
M N O P Q R S T U V W Y

Here's how to interpret the entries:

If the entry is: The function:
Yes Is safe to use.
No Isn't safe to use.
errno Is safe to use, but may change the value of errno.
Depends Might be safe to use - see the function's Caveats section for more information.

A

Function Int Hdlr Sig Hdlr Thread
abort() No Yes Yes
abs() Yes Yes Yes
access(), _access() No errno Yes
acos() No No Yes
acosh() No No Yes
alarm() No errno Yes
alloca() No Yes Yes
asctime(), _asctime() No No Yes
asin() No No Yes
asinh() No No Yes
assert() No No Yes
atan() No No Yes
atan2() No No Yes
atanh() No No Yes
atexit() No No Yes
atof() No No Yes
atoh() Yes Yes Yes
atoi() Yes Yes Yes
atol() Yes Yes Yes

B

Function Int Hdlr Sig Hdlr Thread
basename() Yes Yes Yes
_bcalloc() No??? No??? Yes???
_beginthread() No No Yes
_bexpand() No??? No??? Yes???
_bfree() No??? No??? Yes???
_bfreeseg() Unknown Unknown Unknown
_bgetcmd() Yes Yes Yes
_bheapchk() No??? No??? Yes???
_bheapmin() No??? No??? Yes???
_bheapseg() Unknown Unknown Unknown
_bheapset() No??? No??? Yes???
_bheapshrink() No??? No??? Yes???
_bheapwalk() No??? No??? Yes???
block_read() No errno Yes
block_write() No errno Yes
_bmalloc() No??? No??? No???
_bmsize() Yes??? Yes??? Yes???
_bprintf() No errno Yes
_brealloc() No??? No??? Yes???
bsearch() Yes Yes Yes

C

Function Int Hdlr Sig Hdlr Thread
cabs() No No Yes
calloc() No No Yes
_CA_PCI_BIOS_Present() No No No
_CA_PCI_Find_Class() No No No
_CA_PCI_Find_Device() No No No
_CA_PCI_Generate_SpecialCycle() No No No
_CA_PCI_Read_Config_Byte() No No No
_CA_PCI_Read_Config_DWord() No No No
_CA_PCI_Read_Config_Word() No No No
_CA_PCI_Write_Config_Byte() No No No
_CA_PCI_Write_Config_DWord() No No No
_CA_PCI_Write_Config_Word() No No No
ceil() No No Yes
cfgetispeed() Yes Yes Yes
cfgetospeed() Yes Yes Yes
cfsetispeed() Yes Yes Yes
cfsetospeed() Yes Yes Yes
cgets() No errno Yes
chdir() No errno Yes
chmod() No errno Yes
chown() No errno Yes
chsize() No errno Yes
_clear87() No No Yes
clearenv() No No Yes
clearerr() Yes Yes Yes
clock() No Yes Yes
clock_getres() No errno Yes
clock_gettime() No errno Yes
clock_setres() No errno Yes
clock_settime() No errno Yes
close() No errno Yes
closedir() No No Yes
closelog() No No Yes
_cmdname() No errno Yes
confstr() Yes errno Yes
console_active() No errno Yes
console_arm() No errno Yes
console_close() No No Yes
console_ctrl() No errno Yes
console_font() No errno Yes
console_info() No errno Yes
console_open() No No Yes
console_protocol() No errno Yes
console_read() No errno Yes
console_size() No errno Yes
console_state() No errno Yes
console_write() No errno Yes
_control87() No No Yes
cos() No No Yes
cosh() No No Yes
cprintf() No errno Yes
cputs() No errno Yes
creat() No errno Yes
Creceive() No errno Yes
Creceivemx() No errno Yes
cscanf() No errno Yes
ctermid() No Depends Depends
ctime() No No No
_ctime() No errno Yes
cuserid() No No No

D

Function Int Hdlr Sig Hdlr Thread
delay() No No No
dev_arm() No errno Yes
dev_fdinfo() No errno Yes
dev_info() No errno Yes
dev_insert_chars() No errno Yes
dev_ischars() No errno Yes
dev_mode() No errno Yes
dev_osize() No errno Yes
dev_read() No Depends Depends
dev_readex() No errno Yes
dev_size() No errno Yes
dev_state() No errno Yes
difftime() No No Yes
_disable() Yes Yes Yes
disk_get_entry() No errno Yes
disk_space() No errno Yes
div() Yes Yes Yes
dup() No errno Yes
dup2() No errno Yes

E

Function Int Hdlr Sig Hdlr Thread
ecvt(), _ecvt() No No Yes
_enable() Yes Yes Yes
endgrent() No No No
endpwent() No No No
_endthread() No No Yes
eof() No errno Yes
exec... functions No errno Yes
_exit() No Yes Yes
exit() No No Yes
exp() No No Yes
_expand() No No Yes

F

Function Int Hdlr Sig Hdlr Thread
fabs() No No Yes
_fcalloc() No??? No??? Yes???
fchmod() No errno Yes
fchown() No errno Yes
fclose() No No Yes
fcloseall() No No Yes
fcntl() No errno Yes
fcvt(), _fcvt() No No Yes
fdatasync() No errno Yes
fdopen() No No Yes
feof() No No Yes
ferror() No No Yes
_fexpand() No??? No??? Yes???
fflush() No No Yes
_ffree() No??? No??? Yes???
fgetc() No No Yes
fgetchar() No No Yes
fgetpos() No No Yes
fgets() No No Yes
_fheapchk() No??? No??? Yes???
_fheapgrow() No??? No??? Yes???
_fheapmin() No??? No??? Yes???
_fheapset() No??? No??? Yes???
_fheapshrink() No??? No??? Yes???
_fheapwalk() No??? No??? Yes???
filelength() No No Yes
fileno() No Yes Yes
floor() No No Yes
flushall() No No Yes
_fmalloc() No??? No??? No???
_fmemccpy() Yes Yes Yes
_fmemchr() Yes Yes Yes
_fmemcmp() Yes Yes Yes
_fmemcpy() Yes Yes Yes
_fmemicmp() Yes Yes Yes
_fmemmove() Yes Yes Yes
_fmemset() Yes Yes Yes
fmod() No No Yes
_fmsize() Yes??? Yes??? Yes???
fnmatch() Yes Yes Yes
fopen() No No Yes
fork() No errno Yes
fpathconf() No errno Yes
FP_OFF() Yes Yes Yes
_fpreset() No No Yes
fprintf() No No Yes
FP_SEG() Yes Yes Yes
fputc() No No Yes
fputchar() No No Yes
fputs() No No Yes
fread() No No Yes
_frealloc() No??? No??? Yes???
free() No No Yes
_freect() No No Yes
freopen() No No Yes
frexp() No No Yes
fscanf() No No Yes
fseek() No No Yes
fsetpos() No No Yes
_fsopen() No No Yes
fstat() No errno Yes
_fstrcat() Yes Yes Yes
_fstrchr() Yes Yes Yes
_fstrcmp() Yes Yes Yes
_fstrcpy() Yes Yes Yes
_fstrcspn() Yes Yes Yes
_fstrdup() No No Yes
_fstricmp() Yes Yes Yes
_fstrlen() Yes Yes Yes
_fstrlwr() Yes Yes Yes
_fstrncat() Yes Yes Yes
_fstrncmp() Yes Yes Yes
_fstrncpy() Yes Yes Yes
_fstrnicmp() Yes Yes Yes
_fstrnset() Yes Yes Yes
_fstrpbrk() Yes Yes Yes
_fstrrchr() Yes Yes Yes
_fstrrev() Yes Yes Yes
_fstrset() Yes Yes Yes
_fstrspn() Yes Yes Yes
_fstrstr() Yes Yes Yes
_fstrtok() No No No
_fstrupr() Yes Yes Yes
fsync() No errno Yes
fsys_fdinfo() No errno Yes
fsys_fstat() No errno Yes
fsys_get_mount_dev() No errno Yes
fsys_get_mount_pt() No errno Yes
fsysinfo() No errno Yes
fsys_stat() No errno Yes
ftell() No No Yes
ftime() No errno Yes
_fullpath() Yes Yes Yes
fwrite() No No Yes

G

Function Int Hdlr Sig Hdlr Thread
gcvt(), _gcvt() No No Yes
getc() No No Yes
getch() No Yes Yes
getchar() No No Yes
getche() No Yes Yes
getcmd() No errno Yes
getcwd() No No Yes
getegid() No Yes Yes
getenv() No No No
geteuid() No Yes Yes
getgid() No Yes Yes
getgrent() No No No
getgrgid() No No No
getgrnam() No No No
getgroups() No errno Yes
getlogin() No No No
getnid() No Yes Yes
getopt() No No No
getpgrp() No Yes Yes
getpid() No Yes Yes
getppid() No Yes Yes
getprio() No errno Yes
getpwent() No No No
getpwnam() No No No
getpwuid() No No No
gets() No No Yes
getsid() No No No
getuid() No Yes No
gmtime(), _gmtime() No No Yes

H

Function Int Hdlr Sig Hdlr Thread
halloc() Unknown Unknown Unknown
_heapchk() No No Yes
_heapenable() No No Yes
_heapgrow() No No Yes
_heapmin() No No Yes
_heapset() No No Yes
_heapshrink() No No Yes
_heapwalk() No No Yes
hfree() Unknown Unknown Unknown
hypot() No No Yes

I

Function Int Hdlr Sig Hdlr Thread
inp() Yes Yes Yes
inpd() Yes Yes Yes
input_line() No No No
inpw() Yes Yes Yes
ioctl() No No No
isalnum() Yes Yes Yes
isalpha() Yes Yes Yes
isascii(), __isascii() Yes Yes Yes
isatty() No No No
iscntrl() Yes Yes Yes
__iscsym() Yes Yes Yes
__iscsymf() Yes Yes Yes
isdigit() Yes Yes Yes
isgraph() Yes Yes Yes
islower() Yes Yes Yes
isprint() Yes Yes Yes
ispunct() Yes Yes Yes
isspace() Yes Yes Yes
isupper() Yes Yes Yes
isxdigit() Yes Yes Yes
itoa(), _itoa() No Yes Yes

J

Function Int Hdlr Sig Hdlr Thread
j0() No No Yes
j1() No No Yes
jn() No No Yes

K

Function Int Hdlr Sig Hdlr Thread
kbhit() No No Yes
kill() No Yes Yes

L

Function Int Hdlr Sig Hdlr Thread
labs() No Yes Yes
ldexp() No No Yes
ldiv() No Yes Yes
lfind() No Yes Yes
link() No Yes No
localeconv() No No Yes
localtime(), _localtime() No No Yes
lock() No No Yes
locking(), _locking() No No Yes
log() No No Yes
log10() No No Yes
log2() No No Yes
longjmp() No Yes Yes
_lrotl() Yes Yes Yes
_lrotr() Yes Yes Yes
lsearch() No No Yes
lseek() No Yes No
lstat() No No No
ltoa(), _ltoa() No Yes Yes
ltrunc() No No No

M

Function Int Hdlr Sig Hdlr Thread
_makepath() Yes Yes Yes
malloc() No No No
matherr() No No No
max(), __max() Yes Yes Yes
mblen() Yes Yes Yes
mbstowcs() Yes Yes Yes
mbtowc() Yes Yes Yes
_memavl() No No No
memccpy() Yes Yes Yes
memchr() Yes Yes Yes
memcmp() Yes Yes Yes
memcpy() Yes Yes Yes
memicmp(), _memicmp() Yes Yes Yes
_memmax() No No Yes
memmove() Yes Yes Yes
memset() Yes Yes Yes
min(), __min() Yes Yes Yes
mkdir() No Yes Yes
mkfifo() No Yes Yes
MK_FP() Yes Yes Yes
mknod() No Yes Yes
mktime() No Yes Yes
mmap() No Yes Yes
modf() No No Yes
mount() No Yes Yes
mouse_close() No No Yes
mouse_flush() No No Yes
mouse_open() No No Yes
mouse_param() No No Yes
mouse_read() No No Yes
movedata() Yes Yes Yes
mprotect() No Yes Yes
mq_close() No errno Yes
mq_getattr() No errno Yes
mq_notify() No errno Yes
mq_open() No errno No
mq_receive() No errno Yes
mq_send() No errno Yes
mq_setattr() No errno Yes
mq_unlink() No errno No
_msize() Yes Yes Yes
munmap() No Yes Yes

N

Function Int Hdlr Sig Hdlr Thread
nanosleep() No No No
_ncalloc() No No Yes
_nexpand() No No Yes
_nfree() No No Yes
_nheapchk() No No Yes
_nheapgrow() No No Yes
_nheapmin() No No Yes
_nheapset() No No Yes
_nheapshrink() No No Yes
_nheapwalk() No No Yes
_nmalloc() No No No
_nmsize() Yes Yes Yes
nosound() Yes Yes Yes
_nrealloc() No No Yes

O

Function Int Hdlr Sig Hdlr Thread
offsetof() Yes Yes Yes
onexit() No No Yes
open() No Yes Yes
opendir() No No Yes
openlog() No No Yes
outp() Yes Yes Yes
outpd() Yes Yes Yes
outpw() Yes Yes Yes

P

Function Int Hdlr Sig Hdlr Thread
pathconf() No Yes Yes
pause() No Yes Yes
pclose() No No No
perror() No No Yes
pipe() No Yes Yes
popen() No No No
pow() No No Yes
printf() No No Yes
print_usage() No No Yes
putc() No No Yes
putch() No No Yes
putchar() No No Yes
putenv() No No Yes
puts() No No Yes

Q

Function Int Hdlr Sig Hdlr Thread
qnx_adj_time() No Yes Yes
qnx_device_attach() No Yes Yes
qnx_device_detach() No Yes Yes
qnx_display_hex() No Yes Yes
qnx_display_msg() No Yes Yes
qnx_fd_attach() No errno Yes
qnx_fd_detach() No errno Yes
qnx_fd_query() No errno Yes
qnx_fullpath() No No Yes
qnx_getclock() No errno Yes
qnx_getids() No errno Yes
qnx_hint_attach() No errno Yes
qnx_hint_detach() No errno Yes
qnx_hint_mask() No errno Yes
qnx_hint_query() No errno Yes
qnx_ioctl(), qnx_ioctlmx() No errno Yes
qnx_name_attach() No errno Yes
qnx_name_detach() No errno Yes
qnx_name_locate() No Yes Yes
qnx_name_locators() No Yes Yes
qnx_name_nodes() No Yes Yes
qnx_name_query() No errno Yes
qnx_net_alive() No Yes Yes
qnx_nidtostr() No Yes Yes
qnx_osinfo() No errno Yes
qnx_osstat() No errno Yes
qnx_pflags() No errno Yes
qnx_prefix_attach() No errno Yes
qnx_prefix_detach() No errno Yes
qnx_prefix_getroot() No No Yes
qnx_prefix_query() No errno Yes
qnx_prefix_setroot() No No Yes
qnx_proxy_attach() No errno Yes
qnx_proxy_detach() No errno Yes
qnx_proxy_rem_attach() No errno Yes
qnx_proxy_rem_detach() No errno Yes
qnx_psinfo() No errno Yes
qnx_scheduler() No errno Yes
qnx_segment_alloc() No errno Yes
qnx_segment_alloc_flags() No errno Yes
qnx_segment_arm() No Yes Yes
qnx_segment_flags() No errno Yes
qnx_segment_free() No errno Yes
qnx_segment_get() No errno Yes
qnx_segment_huge() No errno Yes
qnx_segment_index() No errno Yes
qnx_segment_info() No errno Yes
qnx_segment_overlay() No errno Yes
qnx_segment_overlay_flags() No errno Yes
qnx_segment_put() No errno Yes
qnx_segment_raw_alloc() No errno Yes
qnx_segment_raw_free() No errno Yes
qnx_segment_realloc() No errno Yes
qnx_setclock() No errno Yes
qnx_setids() No errno Yes
qnx_sflags() No errno Yes
qnx_sid_query() No errno Yes
qnx_spawn() No No No
qnx_strtonid() No errno Yes
qnx_sync() No errno Yes
qnx_ticksize() No errno Yes
qnx_trace_close() No errno Yes
qnx_trace_info() No errno Yes
qnx_trace_open() No errno Yes
qnx_trace_read() No errno Yes
qnx_trace_severity() No errno Yes
qnx_trace_trigger() No errno Yes
qnx_umask() No errno Yes
qnx_vc_attach() No errno Yes
qnx_vc_detach() No errno Yes
qnx_vc_name_attach() No errno Yes
qnx_vc_poll_parm() No errno Yes
qsort() No Depends Depends

R

Function Int Hdlr Sig Hdlr Thread
raise() No Yes Yes
rand() Yes Yes Yes
read() No errno Yes
readdir() No No Yes
readlink() No No Yes
Readmsg() No errno Yes
Readmsgmx() No errno Yes
readv() No errno Yes
realloc() No No Yes
Receive() No errno Yes
Receivemx() No errno Yes
regcomp() No No No
regerror() Yes Yes Yes
regexec() No No No
regfree() No No Yes
Relay() No errno Yes
remove() No No Yes
rename() No No Yes
Reply() No errno Yes
Replymx() No errno Yes
rewind() No No Yes
rewinddir() No Yes No
rmdir() No No Yes
_rotl() Yes Yes Yes
_rotr() Yes Yes Yes

S

Function Int Hdlr Sig Hdlr Thread
sbrk() No No Yes
scanf() No No Yes
sched_getparam() No errno Yes
sched_getscheduler() No errno Yes
sched_setparam() No errno Yes
sched_setscheduler() No errno Yes
sched_yield() No Yes Yes
_searchenv() No No Yes
searchenv() No No Yes
segread() No Yes Yes
select() No No No
sem_destroy() No errno Yes
sem_init() No errno Depends
sem_post() No errno Yes
sem_trywait() No errno Yes
sem_wait() No errno Yes
Send() No errno Yes
Sendfd() No errno Yes
Sendfdmx() No errno Yes
Sendmx() No errno Yes
setbuf() No No Yes
setegid() No errno Yes
setenv() No No No
seteuid() No errno Yes
setgid() No errno Yes
setgrent() No No No
setjmp() No Yes Yes
setlocale() No No No
setlogmask() No No No
setmode() No No Yes
_setmx() Yes Yes Yes
set_new_handler(), _set_new_handler() No No Yes
setpgid() No errno Yes
setprio() No errno Yes
setpwent() No No No
setsid() No errno Yes
setuid() No errno Yes
setvbuf() No No Yes
shm_open() No errno Yes
shm_unlink() No errno Yes
sigaction() No errno Yes
sigaddset() Yes errno Yes
sigdelset() Yes errno Yes
sigemptyset() Yes errno Yes
sigfillset() Yes errno Yes
sigismember() Yes errno Yes
siglongjmp() No Yes Yes
signal() No errno Yes
sigpending() No errno Yes
sigprocmask() No errno Yes
sigsetjmp() No Yes Yes
sigsuspend() No errno Yes
sin() No No Yes
sinh() No No Yes
sleep() No No No
sopen() No No Yes
sound() Yes Yes Yes
spawn... functions No No Yes
_splitpath() No Yes Yes
_splitpath2() No Yes Yes
sprintf() No No Yes
sqrt() No No Yes
srand() Yes Yes Yes
sscanf() No No Yes
stackavail() No Yes Yes
stat() No No Yes
_status87() No No Yes
strcat() Yes Yes Yes
strchr() Yes Yes Yes
strcmp() Yes Yes Yes
strcmpi() Yes Yes Yes
strcoll() Yes Yes Yes
strcpy() Yes Yes Yes
strcspn() Yes Yes Yes
_strdate() No Yes Yes
strdup(), _strdup() No No Yes
strerror() No Yes Yes
strftime() No errno Yes
stricmp(), _stricmp() Yes Yes Yes
strlen() Yes Yes Yes
strlwr(), _strlwr() Yes Yes Yes
strncat() Yes Yes Yes
strncmp() Yes Yes Yes
strncpy() Yes Yes Yes
strnicmp(), _strnicmp() Yes Yes Yes
strnset() Yes Yes Yes
strpbrk() Yes Yes Yes
strrchr() Yes Yes Yes
strrev(), _strrev() Yes Yes Yes
strset(), _strset() Yes Yes Yes
strspn() Yes Yes Yes
strstr() Yes Yes Yes
_strtime() No Yes Yes
strtod() No errno Yes
strtok() No No No
strtol() No errno Yes
strtoul() No errno Yes
strupr(), _strupr() Yes Yes Yes
strxfrm() No Yes Yes
swab() Yes Yes Yes
symlink() No errno Yes
sync() No Yes Yes
sysconf() No Yes Yes
syslog() No No No
system() No No No

T

Function Int Hdlr Sig Hdlr Thread
tan() No No Yes
tanh() No No Yes
tcdrain() No Yes Yes
tcdropline() No Yes Yes
tcflow() No Yes Yes
tcflush() No Yes Yes
tcgetattr() No Yes Yes
tcgetpgrp() No Yes Yes
tcsendbreak() No Yes Yes
tcsetattr() No Yes Yes
tcsetct() No Yes Yes
tcsetpgrp() No Yes Yes
tell() No Yes Yes
tfork() No Yes Yes
time() No Yes Yes
timer_create() No Yes Yes
timer_delete() No Yes Yes
timer_gettime() No Yes Yes
timer_settime() No Yes Yes
times() No Yes Yes
tmpfile() No No No
tmpnam() No No Yes
tolower(), _tolower() Yes Yes Yes
toupper(), _toupper() Yes Yes Yes
Trace... functions Yes Yes Yes
Trigger() No Yes Yes
ttyname() No No No
tzset() No No No

U

Function Int Hdlr Sig Hdlr Thread
ultoa(), _ultoa() No Yes Yes
umask() No Yes Yes
umount() No No No
uname() No Yes Yes
ungetc() No No Yes
ungetch() No No Yes
unlink() No Yes Yes
unlock() No Yes Yes
utime() No Yes Yes
utoa() No Yes Yes

V

Function Int Hdlr Sig Hdlr Thread
va_arg() No Yes Yes
va_end() No Yes Yes
va_start() No Yes Yes
_vbprintf() No No Yes
vcprintf() No Yes Yes
vcscanf() No Yes Yes
vfprintf() No Yes Yes
vfscanf() No Yes Yes
vprintf() No Yes Yes
vscanf() No Yes Yes
vsprintf() No Yes Yes
vsscanf() No Yes Yes
vsyslog() No No No

W

Function Int Hdlr Sig Hdlr Thread
wait() No Yes Yes
waitpid() No Yes Yes
wcstombs() No Yes Yes
wctomb() No Yes Yes
write() No Yes Yes
Writemsg() No Yes Yes
Writemsgmx() No Yes Yes
writev() No Yes Yes

Y

Function Int Hdlr Sig Hdlr Thread
y0() No No Yes
y1() No No Yes
Yield() No Yes Yes
yn() No No Yes

[Previous]
[Contents]
[Next]