This manual is for GNU Gnulib (updated 1970-01-01 00:00:01), which is a library of common routines intended to be shared at the source level.
Copyright © 2004–2021 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.
gettextize
and autopoint
usersFD_CLR
FD_ISSET
FD_SET
FD_ZERO
_Exit
_exit
_longjmp
_setjmp
_tolower
_toupper
a64l
abort
abs
accept
access
acos
acosf
acosh
acoshf
acoshl
acosl
aio_cancel
aio_error
aio_fsync
aio_read
aio_return
aio_suspend
aio_write
alarm
aligned_alloc
alphasort
asctime
asctime_r
asin
asinf
asinh
asinhf
asinhl
asinl
assert
atan
atan2
atan2f
atan2l
atanf
atanh
atanhf
atanhl
atanl
atexit
atof
atoi
atol
atoll
basename
bind
bsearch
btowc
c16rtomb
c32rtomb
cabs
cabsf
cabsl
cacos
cacosf
cacosh
cacoshf
cacoshl
cacosl
calloc
call_once
canonicalize
canonicalizef
canonicalizel
carg
cargf
cargl
casin
casinf
casinh
casinhf
casinhl
casinl
catan
catanf
catanh
catanhf
catanhl
catanl
catclose
catgets
catopen
cbrt
cbrtf
cbrtl
ccos
ccosf
ccosh
ccoshf
ccoshl
ccosl
ceil
ceilf
ceill
cexp
cexpf
cexpl
cfgetispeed
cfgetospeed
cfsetispeed
cfsetospeed
chdir
chmod
chown
cimag
cimagf
cimagl
clearerr
clock
clock_getcpuclockid
clock_getres
clock_gettime
clock_nanosleep
clock_settime
clog
clogf
clogl
close
closedir
closelog
cnd_broadcast
cnd_destroy
cnd_init
cnd_signal
cnd_timedwait
cnd_wait
confstr
conj
conjf
conjl
connect
copysign
copysignf
copysignl
cos
cosf
cosh
coshf
coshl
cosl
cpow
cpowf
cpowl
cproj
cprojf
cprojl
creal
crealf
creall
creat
crypt
csin
csinf
csinh
csinhf
csinhl
csinl
csqrt
csqrtf
csqrtl
ctan
ctanf
ctanh
ctanhf
ctanhl
ctanl
ctermid
ctime
ctime_r
daddl
daylight
dbm_clearerr
dbm_close
dbm_delete
dbm_error
dbm_fetch
dbm_firstkey
dbm_nextkey
dbm_open
dbm_store
ddivl
difftime
dirfd
dirname
div
dlclose
dlerror
dlopen
dlsym
dmull
dprintf
drand48
dsubl
dup
dup2
duplocale
encrypt
endgrent
endhostent
endnetent
endprotoent
endpwent
endservent
endutxent
environ
erand48
erf
erfc
erfcf
erfcl
erff
erfl
errno
execl
execle
execlp
execv
execve
execvp
exit
exp
exp2
exp2f
exp2l
expf
expl
expm1
expm1f
expm1l
fabs
fabsf
fabsl
faccessat
fadd
faddl
fattach
fchdir
fchmod
fchmodat
fchown
fchownat
fclose
fcntl
fdatasync
fdetach
fdim
fdimf
fdiml
fdiv
fdivl
fdopen
fdopendir
feclearexcept
fegetenv
fegetexceptflag
fegetmode
fegetround
feholdexcept
feof
feraiseexcept
ferror
fesetenv
fesetexcept
fesetexceptflag
fesetmode
fesetround
fetestexcept
fetestexceptflag
feupdateenv
fexecve
fflush
ffs
fgetc
fgetpos
fgets
fgetwc
fgetws
fileno
flockfile
floor
floorf
floorl
fma
fmaf
fmal
fmax
fmaxf
fmaxl
fmaxmag
fmaxmagf
fmaxmagl
fmemopen
fmin
fminf
fminl
fminmag
fminmagf
fminmagl
fmod
fmodf
fmodl
fmtmsg
fmul
fmull
fnmatch
fopen
fork
fpathconf
fpclassify
fprintf
fputc
fputs
fputwc
fputws
fread
free
freeaddrinfo
freelocale
freopen
frexp
frexpf
frexpl
fromfp
fromfpf
fromfpl
fromfpx
fromfpxf
fromfpxl
fscanf
fseek
fseeko
fsetpos
fstat
fstatat
fstatvfs
fsub
fsubl
fsync
ftell
ftello
ftok
ftruncate
ftrylockfile
ftw
funlockfile
futimens
fwide
fwprintf
fwrite
fwscanf
gai_strerror
getaddrinfo
getc
getc_unlocked
getchar
getchar_unlocked
getcwd
getdate
getdate_err
getdelim
getegid
getenv
geteuid
getgid
getgrent
getgrgid
getgrgid_r
getgrnam
getgrnam_r
getgroups
gethostent
gethostid
gethostname
getitimer
getline
getlogin
getlogin_r
getmsg
getnameinfo
getnetbyaddr
getnetbyname
getnetent
getopt
getpayload
getpayloadf
getpayloadl
getpeername
getpgid
getpgrp
getpid
getpmsg
getppid
getpriority
getprotobyname
getprotobynumber
getprotoent
getpwent
getpwnam
getpwnam_r
getpwuid
getpwuid_r
getrlimit
getrusage
gets
getservbyname
getservbyport
getservent
getsid
getsockname
getsockopt
getsubopt
gettimeofday
getuid
getutxent
getutxid
getutxline
getwc
getwchar
glob
globfree
gmtime
gmtime_r
grantpt
hcreate
hdestroy
hsearch
htonl
htons
hypot
hypotf
hypotl
iconv
iconv_close
iconv_open
if_freenameindex
if_indextoname
if_nameindex
if_nametoindex
ilogb
ilogbf
ilogbl
imaxabs
imaxdiv
inet_addr
inet_ntoa
inet_ntop
inet_pton
initstate
insque
ioctl
isalnum
isalnum_l
isalpha
isalpha_l
isascii
isastream
isatty
isblank
isblank_l
iscntrl
iscntrl_l
isdigit
isdigit_l
isfinite
isgraph
isgraph_l
isgreater
isgreaterequal
isinf
isless
islessequal
islessgreater
islower
islower_l
isnan
isnormal
isprint
isprint_l
ispunct
ispunct_l
isspace
isspace_l
isunordered
isupper
isupper_l
iswalnum
iswalnum_l
iswalpha
iswalpha_l
iswblank
iswblank_l
iswcntrl
iswcntrl_l
iswctype
iswctype_l
iswdigit
iswdigit_l
iswgraph
iswgraph_l
iswlower
iswlower_l
iswprint
iswprint_l
iswpunct
iswpunct_l
iswspace
iswspace_l
iswupper
iswupper_l
iswxdigit
iswxdigit_l
isxdigit
isxdigit_l
j0
j1
jn
jrand48
kill
killpg
l64a
labs
lchown
lcong48
ldexp
ldexpf
ldexpl
ldiv
lfind
lgamma
lgammaf
lgammal
link
linkat
lio_listio
listen
llabs
lldiv
llogb
llogbf
llogbl
llrint
llrintf
llrintl
llround
llroundf
llroundl
localeconv
localtime
localtime_r
lockf
log
log10
log10f
log10l
log1p
log1pf
log1pl
log2
log2f
log2l
logb
logbf
logbl
logf
logl
longjmp
lrand48
lrint
lrintf
lrintl
lround
lroundf
lroundl
lsearch
lseek
lstat
malloc
mblen
mbrlen
mbrtoc16
mbrtoc32
mbrtowc
mbsinit
mbsnrtowcs
mbsrtowcs
mbstowcs
mbtowc
memccpy
memchr
memcmp
memcpy
memmove
memset
mkdir
mkdirat
mkdtemp
mkfifo
mkfifoat
mknod
mknodat
mkstemp
mktime
mlock
mlockall
mmap
modf
modff
modfl
mprotect
mq_close
mq_getattr
mq_notify
mq_open
mq_receive
mq_send
mq_setattr
mq_timedreceive
mq_timedsend
mq_unlink
mrand48
msgctl
msgget
msgrcv
msgsnd
msync
mtx_destroy
mtx_init
mtx_lock
mtx_timedlock
mtx_trylock
mtx_unlock
munlock
munlockall
munmap
nan
nanf
nanl
nanosleep
nearbyint
nearbyintf
nearbyintl
newlocale
nextafter
nextafterf
nextafterl
nextdown
nextdownf
nextdownl
nexttoward
nexttowardf
nexttowardl
nextup
nextupf
nextupl
nftw
nice
nl_langinfo
nl_langinfo_l
nrand48
ntohl
ntohs
open
openat
opendir
openlog
open_memstream
open_wmemstream
optarg
opterr
optind
optopt
pathconf
pause
pclose
perror
pipe
poll
popen
posix_fadvise
posix_fallocate
posix_madvise
posix_mem_offset
posix_memalign
posix_openpt
posix_spawn
posix_spawn_file_actions_addclose
posix_spawn_file_actions_adddup2
posix_spawn_file_actions_addopen
posix_spawn_file_actions_destroy
posix_spawn_file_actions_init
posix_spawnattr_destroy
posix_spawnattr_getflags
posix_spawnattr_getpgroup
posix_spawnattr_getschedparam
posix_spawnattr_getschedpolicy
posix_spawnattr_getsigdefault
posix_spawnattr_getsigmask
posix_spawnattr_init
posix_spawnattr_setflags
posix_spawnattr_setpgroup
posix_spawnattr_setschedparam
posix_spawnattr_setschedpolicy
posix_spawnattr_setsigdefault
posix_spawnattr_setsigmask
posix_spawnp
posix_trace_attr_destroy
posix_trace_attr_getclockres
posix_trace_attr_getcreatetime
posix_trace_attr_getgenversion
posix_trace_attr_getinherited
posix_trace_attr_getlogfullpolicy
posix_trace_attr_getlogsize
posix_trace_attr_getmaxdatasize
posix_trace_attr_getmaxsystemeventsize
posix_trace_attr_getmaxusereventsize
posix_trace_attr_getname
posix_trace_attr_getstreamfullpolicy
posix_trace_attr_getstreamsize
posix_trace_attr_init
posix_trace_attr_setinherited
posix_trace_attr_setlogfullpolicy
posix_trace_attr_setlogsize
posix_trace_attr_setmaxdatasize
posix_trace_attr_setname
posix_trace_attr_setstreamfullpolicy
posix_trace_attr_setstreamsize
posix_trace_clear
posix_trace_close
posix_trace_create
posix_trace_create_withlog
posix_trace_event
posix_trace_eventid_equal
posix_trace_eventid_get_name
posix_trace_eventid_open
posix_trace_eventset_add
posix_trace_eventset_del
posix_trace_eventset_empty
posix_trace_eventset_fill
posix_trace_eventset_ismember
posix_trace_eventtypelist_getnext_id
posix_trace_eventtypelist_rewind
posix_trace_flush
posix_trace_get_attr
posix_trace_get_filter
posix_trace_get_status
posix_trace_getnext_event
posix_trace_open
posix_trace_rewind
posix_trace_set_filter
posix_trace_shutdown
posix_trace_start
posix_trace_stop
posix_trace_timedgetnext_event
posix_trace_trid_eventid_open
posix_trace_trygetnext_event
posix_typed_mem_get_info
posix_typed_mem_open
pow
powf
powl
pread
printf
pselect
psiginfo
psignal
pthread_atfork
pthread_attr_destroy
pthread_attr_getdetachstate
pthread_attr_getguardsize
pthread_attr_getinheritsched
pthread_attr_getschedparam
pthread_attr_getschedpolicy
pthread_attr_getscope
pthread_attr_getstack
pthread_attr_getstacksize
pthread_attr_init
pthread_attr_setdetachstate
pthread_attr_setguardsize
pthread_attr_setinheritsched
pthread_attr_setschedparam
pthread_attr_setschedpolicy
pthread_attr_setscope
pthread_attr_setstack
pthread_attr_setstacksize
pthread_barrier_destroy
pthread_barrier_init
pthread_barrier_wait
pthread_barrierattr_destroy
pthread_barrierattr_getpshared
pthread_barrierattr_init
pthread_barrierattr_setpshared
pthread_cancel
pthread_cleanup_pop
pthread_cleanup_push
pthread_cond_broadcast
pthread_cond_destroy
pthread_cond_init
pthread_cond_signal
pthread_cond_timedwait
pthread_cond_wait
pthread_condattr_destroy
pthread_condattr_getclock
pthread_condattr_getpshared
pthread_condattr_init
pthread_condattr_setclock
pthread_condattr_setpshared
pthread_create
pthread_detach
pthread_equal
pthread_exit
pthread_getconcurrency
pthread_getcpuclockid
pthread_getschedparam
pthread_getspecific
pthread_join
pthread_key_create
pthread_key_delete
pthread_kill
pthread_mutex_consistent
pthread_mutex_destroy
pthread_mutex_getprioceiling
pthread_mutex_init
pthread_mutex_lock
pthread_mutex_setprioceiling
pthread_mutex_timedlock
pthread_mutex_trylock
pthread_mutex_unlock
pthread_mutexattr_destroy
pthread_mutexattr_getprioceiling
pthread_mutexattr_getprotocol
pthread_mutexattr_getpshared
pthread_mutexattr_getrobust
pthread_mutexattr_gettype
pthread_mutexattr_init
pthread_mutexattr_setprioceiling
pthread_mutexattr_setprotocol
pthread_mutexattr_setpshared
pthread_mutexattr_setrobust
pthread_mutexattr_settype
pthread_once
pthread_rwlock_destroy
pthread_rwlock_init
pthread_rwlock_rdlock
pthread_rwlock_timedrdlock
pthread_rwlock_timedwrlock
pthread_rwlock_tryrdlock
pthread_rwlock_trywrlock
pthread_rwlock_unlock
pthread_rwlock_wrlock
pthread_rwlockattr_destroy
pthread_rwlockattr_getpshared
pthread_rwlockattr_init
pthread_rwlockattr_setpshared
pthread_self
pthread_setcancelstate
pthread_setcanceltype
pthread_setconcurrency
pthread_setschedparam
pthread_setschedprio
pthread_setspecific
pthread_sigmask
pthread_spin_destroy
pthread_spin_init
pthread_spin_lock
pthread_spin_trylock
pthread_spin_unlock
pthread_testcancel
ptsname
putc
putc_unlocked
putchar
putchar_unlocked
putenv
putmsg
putpmsg
puts
pututxline
putwc
putwchar
pwrite
qsort
quick_exit
raise
rand
rand_r
random
read
readdir
readdir_r
readlink
readlinkat
readv
realloc
realpath
recv
recvfrom
recvmsg
regcomp
regerror
regexec
regfree
remainder
remainderf
remainderl
remove
remque
remquo
remquof
remquol
rename
renameat
rewind
rewinddir
rint
rintf
rintl
rmdir
round
roundeven
roundevenf
roundevenl
roundf
roundl
scalbln
scalblnf
scalblnl
scalbn
scalbnf
scalbnl
scandir
scanf
sched_get_priority_max
sched_get_priority_min
sched_getparam
sched_getscheduler
sched_rr_get_interval
sched_setparam
sched_setscheduler
sched_yield
seed48
seekdir
select
sem_close
sem_destroy
sem_getvalue
sem_init
sem_open
sem_post
sem_timedwait
sem_trywait
sem_unlink
sem_wait
semctl
semget
semop
send
sendmsg
sendto
setbuf
setegid
setenv
seteuid
setgid
setgrent
sethostent
setitimer
setjmp
setkey
setlocale
setlogmask
setnetent
setpayload
setpayloadf
setpayloadl
setpayloadsig
setpayloadsigf
setpayloadsigl
setpgid
setpgrp
setpriority
setprotoent
setpwent
setregid
setreuid
setrlimit
setservent
setsid
setsockopt
setstate
setuid
setutxent
setvbuf
shm_open
shm_unlink
shmat
shmctl
shmdt
shmget
shutdown
sigaction
sigaddset
sigaltstack
sigdelset
sigemptyset
sigfillset
sighold
sigignore
siginterrupt
sigismember
siglongjmp
signal
signbit
signgam
sigpause
sigpending
sigprocmask
sigqueue
sigrelse
sigset
sigsetjmp
sigsuspend
sigtimedwait
sigwait
sigwaitinfo
sin
sinf
sinh
sinhf
sinhl
sinl
sleep
snprintf
sockatmark
socket
socketpair
sprintf
sqrt
sqrtf
sqrtl
srand
srand48
srandom
sscanf
stat
statvfs
stderr
stdin
stdout
stpcpy
stpncpy
strcasecmp
strcasecmp_l
strcat
strchr
strcmp
strcoll
strcoll_l
strcpy
strcspn
strdup
strerror
strerror_l
strerror_r
strfmon
strfmon_l
strfromd
strfromf
strfroml
strftime
strftime_l
strlen
strncasecmp
strncasecmp_l
strncat
strncmp
strncpy
strndup
strnlen
strpbrk
strptime
strrchr
strsignal
strspn
strstr
strtod
strtof
strtoimax
strtok
strtok_r
strtol
strtold
strtoll
strtoul
strtoull
strtoumax
strxfrm
strxfrm_l
swab
swprintf
swscanf
symlink
symlinkat
sync
sysconf
syslog
system
tan
tanf
tanh
tanhf
tanhl
tanl
tcdrain
tcflow
tcflush
tcgetattr
tcgetpgrp
tcgetsid
tcsendbreak
tcsetattr
tcsetpgrp
tdelete
telldir
tempnam
tfind
tgamma
tgammaf
tgammal
thrd_create
thrd_current
thrd_detach
thrd_equal
thrd_exit
thrd_join
thrd_sleep
thrd_yield
time
timer_create
timer_delete
timer_getoverrun
timer_gettime
timer_settime
times
timezone
tmpfile
tmpnam
toascii
tolower
tolower_l
totalorder
totalorderf
totalorderl
totalordermag
totalordermagf
totalordermagl
toupper
toupper_l
towctrans
towctrans_l
towlower
towlower_l
towupper
towupper_l
trunc
truncate
truncf
truncl
tsearch
tss_create
tss_delete
tss_get
tss_set
ttyname
ttyname_r
twalk
tzname
tzset
ufromfp
ufromfpf
ufromfpl
ufromfpx
ufromfpxf
ufromfpxl
ulimit
umask
uname
ungetc
ungetwc
unlink
unlinkat
unlockpt
unsetenv
uselocale
utime
utimensat
utimes
va_arg
va_copy
va_end
va_start
vdprintf
vfprintf
vfscanf
vfwprintf
vfwscanf
vprintf
vscanf
vsnprintf
vsprintf
vsscanf
vswprintf
vswscanf
vwprintf
vwscanf
wait
waitid
waitpid
wcpcpy
wcpncpy
wcrtomb
wcscasecmp
wcscasecmp_l
wcscat
wcschr
wcscmp
wcscoll
wcscoll_l
wcscpy
wcscspn
wcsdup
wcsftime
wcslen
wcsncasecmp
wcsncasecmp_l
wcsncat
wcsncmp
wcsncpy
wcsnlen
wcsnrtombs
wcspbrk
wcsrchr
wcsrtombs
wcsspn
wcsstr
wcstod
wcstof
wcstoimax
wcstok
wcstol
wcstold
wcstoll
wcstombs
wcstoul
wcstoull
wcstoumax
wcswidth
wcsxfrm
wcsxfrm_l
wctob
wctomb
wctrans
wctrans_l
wctype
wctype_l
wcwidth
wmemchr
wmemcmp
wmemcpy
wmemmove
wmemset
wordexp
wordfree
wprintf
write
writev
wscanf
y0
y1
yn
bcmp
bcopy
bsd_signal
bzero
ecvt
fcvt
ftime
gcvt
getcontext
gethostbyaddr
gethostbyname
getwd
h_errno
index
makecontext
mktemp
pthread_attr_getstackaddr
pthread_attr_setstackaddr
rindex
scalb
setcontext
swapcontext
ualarm
usleep
vfork
wcswcs
<aio.h>
<aliases.h>
<argp.h>
<argz.h>
<arpa/inet.h>
<byteswap.h>
<complex.h>
<ctype.h>
<dirent.h>
<dlfcn.h>
<envz.h>
<err.h>
<errno.h>
<error.h>
<execinfo.h>
<fcntl.h>
<fenv.h>
<fmtmsg.h>
<fstab.h>
<fts.h>
<getopt.h>
<glob.h>
<gnu/libc-version.h>
<grp.h>
<gshadow.h>
<ifaddrs.h>
<libintl.h>
<link.h>
<malloc.h>
<math.h>
drem
dremf
dreml
exp10
exp10f
exp10l
finite
finitef
finitel
gamma
gammaf
gammal
isinff
isinfl
isnanf
isnanl
j0f
j0l
j1f
j1l
jnf
jnl
lgamma_r
lgammaf_r
lgammal_r
matherr
pow10
pow10f
pow10l
scalbf
scalbl
significand
significandf
significandl
sincos
sincosf
sincosl
y0f
y0l
y1f
y1l
ynf
ynl
<mcheck.h>
<mntent.h>
<netdb.h>
endnetgrent
gethostbyaddr_r
gethostbyname2
gethostbyname2_r
gethostbyname_r
gethostent_r
getnetbyaddr_r
getnetbyname_r
getnetent_r
getnetgrent
getnetgrent_r
getprotobyname_r
getprotobynumber_r
getprotoent_r
getservbyname_r
getservbyport_r
getservent_r
herror
hstrerror
innetgr
rcmd
rcmd_af
rexec
rexec_af
rresvport
rresvport_af
ruserok
ruserok_af
setnetgrent
<netinet/ether.h>
<netinet/in.h>
bindresvport
getipv4sourcefilter
getsourcefilter
in6addr_any
in6addr_loopback
inet6_option_alloc
inet6_option_append
inet6_option_find
inet6_option_init
inet6_option_next
inet6_option_space
inet6_opt_append
inet6_opt_find
inet6_opt_finish
inet6_opt_get_val
inet6_opt_init
inet6_opt_next
inet6_opt_set_val
inet6_rth_add
inet6_rth_getaddr
inet6_rth_init
inet6_rth_reverse
inet6_rth_segments
inet6_rth_space
setipv4sourcefilter
setsourcefilter
<obstack.h>
<poll.h>
<printf.h>
<pthread.h>
pthread_attr_getaffinity_np
pthread_attr_setaffinity_np
pthread_attr_getsigmask_np
pthread_attr_setsigmask_np
pthread_clockjoin_np
pthread_cond_clockwait
pthread_getaffinity_np
pthread_getattr_default_np
pthread_getattr_np
pthread_getname_np
pthread_kill_other_threads_np
pthread_mutex_clocklock
pthread_mutex_consistent_np
pthread_mutexattr_getrobust_np
pthread_mutexattr_setrobust_np
pthread_rwlock_clockrdlock
pthread_rwlock_clockwrlock
pthread_rwlockattr_getkind_np
pthread_rwlockattr_setkind_np
pthread_setaffinity_np
pthread_setattr_default_np
pthread_setname_np
pthread_sigqueue
pthread_timedjoin_np
pthread_tryjoin_np
pthread_yield
<pty.h>
<pwd.h>
<regex.h>
<regexp.h>
<resolv.h>
<rpc/auth.h>
authdes_create
authdes_pk_create
authnone_create
authunix_create
authunix_create_default
getnetname
host2netname
key_decryptsession
key_decryptsession_pk
key_encryptsession
key_encryptsession_pk
key_gendes
key_get_conv
key_secretkey_is_set
key_setsecret
netname2host
netname2user
user2netname
xdr_des_block
xdr_opaque_auth
<rpc/auth_des.h>
<rpc/auth_unix.h>
<rpc/clnt.h>
callrpc
clnt_create
clnt_pcreateerror
clnt_perrno
clnt_perror
clnt_spcreateerror
clnt_sperrno
clnt_sperror
clntraw_create
clnttcp_create
clntudp_bufcreate
clntudp_create
clntunix_create
get_myaddress
getrpcport
rpc_createerr
<rpc/key_prot.h>
<rpc/netdb.h>
<rpc/pmap_clnt.h>
<rpc/pmap_prot.h>
<rpc/pmap_rmt.h>
<rpc/rpc_msg.h>
<rpc/svc.h>
svc_exit
svc_fdset
svc_getreq
svc_getreq_common
svc_getreq_poll
svc_getreqset
svc_max_pollfd
svc_pollfd
svc_register
svc_run
svc_sendreply
svc_unregister
svcerr_auth
svcerr_decode
svcerr_noproc
svcerr_noprog
svcerr_progvers
svcerr_systemerr
svcerr_weakauth
svcraw_create
svctcp_create
svcudp_bufcreate
svcudp_create
svcunix_create
xprt_register
xprt_unregister
<rpc/xdr.h>
xdr_array
xdr_bool
xdr_bytes
xdr_char
xdr_double
xdr_enum
xdr_float
xdr_free
xdr_hyper
xdr_int
xdr_int16_t
xdr_int32_t
xdr_int64_t
xdr_int8_t
xdr_long
xdr_longlong_t
xdr_netobj
xdr_opaque
xdr_pointer
xdr_quad_t
xdr_reference
xdr_short
xdr_sizeof
xdr_string
xdr_u_char
xdr_u_hyper
xdr_u_int
xdr_u_long
xdr_u_longlong_t
xdr_u_quad_t
xdr_u_short
xdr_uint16_t
xdr_uint32_t
xdr_uint64_t
xdr_uint8_t
xdr_union
xdr_vector
xdr_void
xdr_wrapstring
xdrmem_create
xdrrec_create
xdrrec_endofrecord
xdrrec_eof
xdrrec_skiprecord
xdrstdio_create
<rpcsvc/nislib.h>
nis_add
nis_add_entry
nis_addmember
nis_checkpoint
nis_clone_object
nis_creategroup
nis_destroy_object
nis_destroygroup
nis_dir_cmp
nis_domain_of
nis_domain_of_r
nis_first_entry
nis_freenames
nis_freeresult
nis_freeservlist
nis_freetags
nis_getnames
nis_getservlist
nis_ismember
nis_leaf_of
nis_leaf_of_r
nis_lerror
nis_list
nis_local_directory
nis_local_group
nis_local_host
nis_local_principal
nis_lookup
nis_mkdir
nis_modify
nis_modify_entry
nis_name_of
nis_name_of_r
nis_next_entry
nis_perror
nis_ping
nis_print_directory
nis_print_entry
nis_print_group
nis_print_group_entry
nis_print_link
nis_print_object
nis_print_result
nis_print_rights
nis_print_table
nis_remove
nis_remove_entry
nis_removemember
nis_rmdir
nis_servstate
nis_sperrno
nis_sperror
nis_sperror_r
nis_stats
nis_verifygroup
<rpcsvc/nis_callback.h>
<rpcsvc/yp.h>
xdr_domainname
xdr_keydat
xdr_valdat
xdr_ypbind_resptype
xdr_ypmap_parms
xdr_ypmaplist
xdr_yppushresp_xfr
xdr_ypreq_key
xdr_ypreq_nokey
xdr_ypreq_xfr
xdr_ypresp_all
xdr_ypresp_key_val
xdr_ypresp_maplist
xdr_ypresp_master
xdr_ypresp_order
xdr_ypresp_val
xdr_ypresp_xfr
xdr_ypstat
xdr_ypxfrstat
<rpcsvc/ypclnt.h>
<sched.h>
<search.h>
<selinux/selinux.h>
<semaphore.h>
<shadow.h>
<signal.h>
<spawn.h>
<stdio.h>
asprintf
cuserid
clearerr_unlocked
fcloseall
feof_unlocked
ferror_unlocked
fflush_unlocked
fgetc_unlocked
fgets_unlocked
fileno_unlocked
fopencookie
fputc_unlocked
fputs_unlocked
fread_unlocked
fwrite_unlocked
getw
putw
renameat2
setbuffer
setlinebuf
sys_errlist
sys_nerr
tmpnam_r
vasprintf
<stdlib.h>
canonicalize_file_name
cfree
clearenv
drand48_r
ecvt_r
erand48_r
fcvt_r
getloadavg
getpt
initstate_r
jrand48_r
lcong48_r
lrand48_r
mkostemp
mkostemps
mrand48_r
mkstemps
nrand48_r
on_exit
ptsname_r
qecvt
qecvt_r
qfcvt
qfcvt_r
qgcvt
qsort_r
random_r
rpmatch
secure_getenv
seed48_r
setstate_r
srand48_r
srandom_r
strtod_l
strtof_l
strtol_l
strtold_l
strtoll_l
strtoq
strtoul_l
strtoull_l
strtouq
valloc
<string.h>
explicit_bzero
ffsl
ffsll
memfrob
memmem
mempcpy
memrchr
rawmemchr
sigabbrev_np
sigdescr_np
strcasestr
strchrnul
strerrordesc_np
strerrorname_np
strfry
strsep
strverscmp
<sys/auxv.h>
<sys/capability.h>
<sys/epoll.h>
<sys/eventfd.h>
<sys/fanotify.h>
<sys/file.h>
<sys/fsuid.h>
<sys/gmon.h>
<sys/inotify.h>
<sys/io.h>
, <sys/perm.h>
<sys/kdaemon.h>
<sys/klog.h>
<sys/mman.h>
<sys/mount.h>
<sys/personality.h>
<sys/prctl.h>
<sys/profil.h>
<sys/ptrace.h>
<sys/quota.h>
<sys/random.h>
<sys/reboot.h>
<sys/resource.h>
<sys/sem.h>
<sys/sendfile.h>
<sys/signalfd.h>
<sys/single_threaded.h>
<sys/socket.h>
<sys/stat.h>
<sys/statfs.h>
<sys/swap.h>
<sys/sysctl.h>
<sys/sysinfo.h>
<sys/syslog.h>
<sys/sysmacros.h>
<sys/time.h>
<sys/timerfd.h>
<sys/timex.h>
<sys/uio.h>
<sys/ustat.h>
<sys/vlimit.h>
<sys/wait.h>
<sys/xattr.h>
<termios.h>
<time.h>
<ttyent.h>
<unistd.h>
acct
brk
chroot
copy_file_range
daemon
dup3
eaccess
endusershell
euidaccess
execvpe
get_current_dir_name
getdomainname
getdtablesize
getpagesize
getpass
getresgid
getresuid
gettid
getusershell
group_member
pipe2
profil
revoke
sbrk
setlogin
setdomainname
sethostid
sethostname
setresgid
setresuid
setusershell
syncfs
syscall
ttyslot
vhangup
<utmp.h>
<utmpx.h>
<wchar.h>
fgetwc_unlocked
fgetws_unlocked
fputwc_unlocked
fputws_unlocked
getwc_unlocked
getwchar_unlocked
putwc_unlocked
putwchar_unlocked
wcschrnul
wcsftime_l
wcstod_l
wcstof_l
wcstol_l
wcstold_l
wcstoll_l
wcstoq
wcstoul_l
wcstoull_l
wcstouq
wmempcpy
.
)|
or \|
)[
… ]
and [^
… ]
)
(
… )
or \(
… \)
)\b
)\B
)\<
)\>
)\w
)\W
)Gnulib is a source code library that provides basic functionality to programs and libraries. Many software packages make use of Gnulib to avoid reinventing the portability wheel.
Resources:
While portability across operating systems is not one of GNU’s primary goals, it has helped introduce many people to the GNU system, and is worthwhile when it can be achieved at a low cost. This collection helps lower that cost.
Gnulib is intended to be the canonical source for most of the important “portability” and/or common files for GNU projects. These are files intended to be shared at the source level; Gnulib is not a typical library meant to be installed and linked against. Thus, unlike most projects, Gnulib does not normally generate a source tarball distribution; instead, developers grab modules directly from the source repository.
The easiest, and recommended, way to do this is to use the
gnulib-tool
script. Since there is no installation
procedure for Gnulib, gnulib-tool
needs to be run directly
in the directory that contains the Gnulib source code. You can do
this either by specifying the absolute filename of
gnulib-tool
, or by using a symbolic link from a place inside
your PATH
to the gnulib-tool
file of your preferred
Gnulib checkout. For example:
$ ln -s $HOME/gnu/src/gnulib.git/gnulib-tool $HOME/bin/gnulib-tool
Gnulib is available for anonymous checkout. In any Bourne-shell the following should work:
$ git clone https://git.savannah.gnu.org/git/gnulib.git
For a read-write checkout you need to have a login on ‘savannah.gnu.org’ and be a member of the Gnulib project at https://savannah.gnu.org/projects/gnulib. Then, instead of the URL https://git.savannah.gnu.org/git/gnulib.git, use the URL ‘ssh://user@git.savannah.gnu.org/srv/git/gnulib’ where user is your login name on savannah.gnu.org.
git resources:
When you use git annotate
or git blame
with Gnulib, it’s
recommended that you use the -w option, in order to ignore
massive whitespace changes that happened in 2009.
The best way to work with Gnulib is to check it out of git.
To synchronize, you can use git pull
.
Subscribing to the bug-gnulib@gnu.org mailing list will help you to plan when to update your local copy of Gnulib (which you use to maintain your software) from git. You can review the archives, subscribe, etc., via https://lists.gnu.org/mailman/listinfo/bug-gnulib.
Sometimes, using an updated version of Gnulib will require you to use newer versions of GNU Automake or Autoconf. You may find it helpful to join the autotools-announce mailing list to be advised of such changes.
All software here is copyrighted by the Free Software Foundation—you need to have filled out an assignment form for a project that uses the module for that contribution to be accepted here.
If you have a piece of code that you would like to contribute, please email bug-gnulib@gnu.org.
Generally we are looking for files that fulfill at least one of the following requirements:
If your functions define completely new but rarely used functionality, you should probably consider packaging it as a separate library.
Gnulib contains code both under GPL and LGPL. Because several packages that use Gnulib are GPL, the files state they are licensed under GPL. However, to support LGPL projects as well, you may use some of the files under LGPL. The “License:” information in the files under modules/ clarifies the real license that applies to the module source.
Keep in mind that if you submit patches to files in Gnulib, you should license them under a compatible license, which means that sometimes the contribution will have to be LGPL, if the original file is available under LGPL via a “License: LGPL” information in the projects’ modules/ file.
We use space-only indentation in nearly all files. This includes all
*.h, *.c, *.y files, except for the regex
module. Makefile and ChangeLog files are excluded, since TAB
characters are part of their format.
In order to tell your editor to produce space-only indentation, you can use these instructions.
;; In Gnulib, indent with spaces everywhere (not TABs). ;; Exceptions: Makefile and ChangeLog modes. (add-hook 'find-file-hook '(lambda () (if (and buffer-file-name (string-match "/gnulib\\>" (buffer-file-name)) (not (string-equal mode-name "Change Log")) (not (string-equal mode-name "Makefile"))) (setq indent-tabs-mode nil))))
" Don't use tabs for indentation. Spaces are nicer to work with. set expandtab
For Makefile and ChangeLog files, compensate for this by adding this to your $HOME/.vim/after/indent/make.vim file, and similarly for your $HOME/.vim/after/indent/changelog.vim file:
" Use tabs for indentation, regardless of the global setting. set noexpandtab
If you use the GNU indent program, pass it the option --no-tabs.
You can test that a module builds correctly with:
$ ./gnulib-tool --create-testdir --dir=/tmp/testdir module1 ... moduleN $ cd /tmp/testdir $ ./configure && make
Other things:
alloca
and fnmatch
modules for how to achieve this. If
for some reason you cannot do this, and you have a .c file that
leads to an empty .o file on some platforms (through some big
#if
around all the code), then ensure that the compilation unit
is not empty after preprocessing. One way to do this is to
#include <stddef.h>
or <stdio.h>
before the big
#if
.
Gnulib code is intended to be portable to a wide variety of platforms, not just GNU platforms. Gnulib typically attempts to support a platform as long as it is still supported by its provider, even if the platform is not the latest version. See Target Platforms.
Many Gnulib modules exist so that applications need not worry about
undesirable variability in implementations. For example, an
application that uses the malloc
module need not worry about
malloc (0)
returning NULL
on some Standard C
platforms; and glob
users need not worry about glob
silently omitting symbolic links to nonexistent files on some
platforms that do not conform to POSIX.
Gnulib code is intended to port without problem to new hosts, e.g.,
hosts conforming to recent C and POSIX standards. Hence Gnulib code
should avoid using constructs that these newer standards no longer
require, without first testing for the presence of these constructs.
For example, because C11 made variable length arrays optional, Gnulib
code should avoid them unless it first uses the vararrays
module to check whether they are supported.
The following subsections discuss some exceptions and caveats to the general Gnulib portability guidelines.
Currently Gnulib assumes at least a freestanding C99 compiler, possibly operating with a C library that predates C99; with time this assumption will likely be strengthened to later versions of the C standard. Old platforms currently supported include AIX 6.1, HP-UX 11i v1 and Solaris 10, though these platforms are rarely tested. Gnulib itself is so old that it contains many fixes for obsolete platforms, fixes that may be removed in the future.
Because of the freestanding C99 assumption, Gnulib code can include
<float.h>
, <limits.h>
, <stdarg.h>
,
<stdbool.h>
, <stddef.h>
, and <stdint.h>
unconditionally. Gnulib code can also assume the existence
of <ctype.h>
, <errno.h>
, <fcntl.h>
,
<locale.h>
, <signal.h>
, <stdio.h>
,
<stdlib.h>
, <string.h>
, and <time.h>
. Similarly,
many modules include <sys/types.h>
even though it’s not even in
C11; that’s OK since <sys/types.h>
has been around nearly
forever.
Even if the include files exist, they may not conform to the C standard.
However, GCC has a fixincludes
script that attempts to fix most
C89-conformance problems. Gnulib currently assumes include files
largely conform to C89 or better. People still using ancient hosts
should use fixincludes or fix their include files manually.
Even if the include files conform, the library itself may not.
For example, strtod
and mktime
have some bugs on some platforms.
You can work around some of these problems by requiring the relevant
modules, e.g., the Gnulib mktime
module supplies a working and
conforming mktime
.
Although the C99 standard specifies many features, Gnulib code is conservative about using them, partly because Gnulib predates the widespread adoption of C99, and partly because many C99 features are not well-supported in practice. C99 features that are reasonably portable nowadays include:
for
statement.
long long int
.
<stdbool.h>
, assuming the stdbool
module is used.
See stdbool.h.
<stdint.h>
, assuming the stdint
module is used.
See stdint.h.
static inline
functions.
__func__
, assuming the func
module is used. See func.
restrict
qualifier, assuming
AC_REQUIRE([AC_C_RESTRICT])
is used.
This qualifier is sometimes implemented via a macro, so C++ code that
uses Gnulib should avoid using restrict
as an identifier.
flexmember
module).
Gnulib avoids some features even though they are standardized by C99, as they have portability problems in practice. Here is a partial list of avoided C99 features. Many other C99 features are portable only if their corresponding modules are used; Gnulib code that uses such a feature should require the corresponding module.
__STDC_NO_VLA__
is defined.
See the vararrays
module.
extern inline
functions, without checking whether they are
supported. See Extern inline functions.
<iso646.h>
, since GNU programs need not worry about deficient
source-code encodings.
The GNU coding standards allow one departure from strict C: Gnulib
code can assume that standard internal types like
ptrdiff_t
and size_t
are no
wider than long
. POSIX requires implementations to support at
least one programming environment where this is true, and such
environments are recommended for Gnulib-using applications. When it
is easy to port to non-POSIX platforms like MinGW where these types
are wider than long
, new Gnulib code should do so, e.g., by
using ptrdiff_t
instead of long
. However, it is not
always that easy, and no effort has been made to check that all Gnulib
modules work on MinGW-like environments.
Gnulib code makes the following additional assumptions:
int
and unsigned int
are at least 32 bits wide. POSIX
and the GNU coding standards both require this.
Previously, Gnulib code sometimes also assumed that signed integer arithmetic wraps around, but modern compiler optimizations sometimes do not guarantee this, and Gnulib code with this assumption is now considered to be questionable. See Integer Properties.
Although some Gnulib modules contain explicit support for the other signed integer representations allowed by the C standard (ones’ complement and signed magnitude), these modules are the exception rather than the rule. All practical Gnulib targets use two’s complement.
memset (A, 0, sizeof A)
initializes an array A
of
pointers to NULL.
intptr_t
and uintptr_t
exist, and pointers
can be converted to and from these types without loss of information.
ptrdiff_t
or size_t
values, then S + T
cannot overflow.
(char *) &O <= (char *) P && (char *) P <
(char *) (&O + 1)
.
uintptr_t
, except that offsets are
multiplied by the size of the pointed-to objects.
For example, if P + I
is a valid expression involving a pointer
P and an integer I, then (uintptr_t) (P + I) ==
(uintptr_t) ((uintptr_t) P + I * sizeof *P)
.
Similar arithmetic can be done with intptr_t
, although more
care must be taken in case of integer overflow or negative integers.
P
has alignment A
if and only if
(uintptr_t) P % A
is zero, and similarly for intptr_t
.
S + T
cannot overflow.
Overflow in this case would mean that the rest of your program fits
into T bytes, which can’t happen in realistic flat-address-space
hosts.
0 + (char *) NULL == (char *) NULL
.
Some system platforms violate these assumptions and are therefore not Gnulib porting targets. See Unsupported Platforms.
We develop and maintain a testsuite for Gnulib. The goal is to have a 100% firm interface so that maintainers can feel free to update to the code in git at any time and know that their application will not break. This means that before any change can be committed to the repository, a test suite program must be produced that exposes the bug for regression testing. All experimental work should be done on branches to help promote this.
When compiling and testing Gnulib and Gnulib-using programs, certain
compiler options can help improve reliability. The
manywarnings
module enables several forms of static checking in
GCC and related compilers (see manywarnings). For dynamic checking,
you can run configure
with CFLAGS
options appropriate
for your compiler. For example:
./configure \ CFLAGS='-g3 -O2'\ ' -D_FORTIFY_SOURCE=2'\ ' -fsanitize=undefined'\ ' -fsanitize-undefined-trap-on-error'
Here:
-D_FORTIFY_SOURCE=2
enables extra security hardening checks in
the GNU C library.
-fsanitize=undefined
enables GCC’s undefined behavior sanitizer
(ubsan
), and
-fsanitize-undefined-trap-on-error
causes ubsan
to
abort the program (through an “illegal instruction” signal). This
measure stops exploit attempts and also allows you to debug the issue.
Without the -fsanitize-undefined-trap-on-error
option,
-fsanitize=undefined
causes messages to be printed, and
execution continues after an undefined behavior situation.
The message printing causes GCC-like compilers to arrange for the
program to dynamically link to libraries it might not otherwise need.
With GCC, instead of -fsanitize-undefined-trap-on-error
you can
use the -static-libubsan
option to arrange for two of the extra
libraries (libstdc++
and libubsan
) to be linked
statically rather than dynamically, though this typically bloats the
executable and the remaining extra libraries are still linked
dynamically.
Gnulib’s design and development philosophy is organized around steady, collaborative, and open development of reusable modules that are suitable for a reasonably wide variety of platforms.
Gnulib is useful to enhance various aspects of a package:
asprintf
, canonicalize_file_name
are not affected
by buffer sizing problems that affect sprintf
, realpath
.
openat
does not have the race conditions that open
has. Etc.
xalloc
,
xprintf
, xstrtod
, xgetcwd
.
Classical libraries are installed as binary object code. Gnulib is
different: It is used as a source code library. Each package that uses
Gnulib thus ships with part of the Gnulib source code. The used portion
of Gnulib is tailored to the package: A build tool, called
gnulib-tool
, is provided that copies a tailored subset of Gnulib
into the package.
One of the goals of Gnulib is to make portable programming easy, on the basis of the standards relevant for GNU (and Unix). The objective behind that is to avoid a fragmentation of the user community into disjoint user communities according to the operating system, and instead allow synergies between users on different operating systems.
Another goal of Gnulib is to provide application code that can be shared between several applications. Some people wonder: "What? glibc doesn’t have a function to copy a file?" Indeed, the scope of a system’s libc is to implement the relevant standards (ISO C, POSIX) and to provide access functions to the kernel’s system calls, and little more.
There is no clear borderline between both areas.
For example, Gnulib has a facility for generating the name of backup files. While this task is entirely at the application level—no standard specifies an API for it—the naïve code has some portability problems because on some platforms the length of file name components is limited to 30 characters or so. Gnulib handles that.
Similarly, Gnulib has a facility for executing a command in a
subprocess. It is at the same time a portability enhancement (it
works on GNU, Unix, and Windows, compared to the classical
fork
/exec
idiom which is not portable to Windows), as well
as an application aid: it takes care of redirecting stdin and/or
stdout if desired, and emits an error message if the subprocess
failed.
Gnulib supports a number of platforms that we call the “reasonable portability targets”. This class consists of widespread operating systems, for three years after their last availability, or—for proprietary operating systems—as long as the vendor provides commercial support for it. Already existing Gnulib code for older operating systems is usually left in place for longer than these three years. So it comes that programs that use Gnulib run pretty well also on these older operating systems.
Some operating systems are not very widespread, but are Free Software and are actively developed. Such platforms are also supported by Gnulib, if that OS’s developers community keeps in touch with the Gnulib developers, by providing bug reports, analyses, or patches. For such platforms, Gnulib supports only the versions of the last year or the last few months, depending on the maturity of said OS project, the number of its users, and how often these users upgrade.
Niche operating systems are generally unsupported by Gnulib, unless some of their developers or users contribute support to Gnulib.
The degree of support Gnulib guarantees for a platform depends on the amount of testing it gets from volunteers. Platforms on which Gnulib is frequently tested are the best supported. Then come platforms with occasional testing, then platforms which are rarely tested. Usually, we fix bugs when they are reported. Except that some rarely tested platforms are also low priority; bug fixes for these platforms can take longer.
As of 2020, the list of supported platforms is the following:
mgetgroups
, getugroups
, idcache
,
userspec
, openpty
, login_tty
, forkpty
,
pt_chown
, grantpt
, pty
, savewd
,
mkancesdirs
, mkdir-p
, euidaccess
, faccessat
.
The versions of Windows that are supported are Windows XP and newer.
Only the latest version of mingw is tested; older versions are not supported.
The following platforms were supported in the past, but are no longer supported:
Gnulib supports these operating systems only in an unvirtualized environment.
When you run an OS inside a virtual machine, you have to be aware that the
virtual machine can bring in bugs of its own. For example, floating-point
operations on Solaris can behave slightly differently in QEMU than on real
hardware. And Haiku’s bash
program misbehaves in VirtualBox 3,
whereas it behaves fine in VirtualBox 4.
Similarly, running native Windows binaries on GNU/Linux under WINE is rarely tested and low priority: WINE has a set of behaviours and bugs that is slightly different from native Windows.
Some platforms with C compilers are not supported by Gnulib because the platforms violate Gnulib’s C portability assumptions. See Other portability assumptions made by Gnulib.
These assumptions are not required by the C or POSIX standards but hold on almost all practical porting targets. If you need to port Gnulib code to a platform where these assumptions are not true, we would appreciate hearing of any fixes. We need fixes that do not increase runtime overhead on standard hosts and that are relatively easy to maintain.
These platforms are listed below to illustrate problems that Gnulib and Gnulib-using code would have if it were intended to be portable to all practical POSIX or C platforms.
intptr_t
and uintptr_t
, which are optional in the C and
POSIX standards. However, these two types are required for the XSI
extension to POSIX, and many Gnulib modules use them. To work around
this compatibility problem, Gnulib-using applications can be run on
the IBM i’s PASE emulation environment. The IBM i’s architecture
descends from the System/38 (1978).
CHAR_BIT == 9
and INT_MIN == -INT_MAX
. By default
UINT_MAX
is 2^{36} - 2, which does not conform to the C
requirement that it be one less than a power of two. Although
compiler options can raise UINT_MAX
to be 2^{36} - 1,
this can break system code that uses -0 as a flag value.
This platform’s architecture descends from the UNIVAC 1107 (1962).
unsigned int
uses the low-order 40 bits of the word, and
int
uses the low-order 41 bits of the word with a
signed-magnitude representation. On these machines, INT_MAX ==
UINT_MAX
, INT_MIN == -INT_MAX
, and sizeof (int) == 6
.
This platform’s architecture descends from the Burroughs B5000 (1961).
The following platforms are not supported by Gnulib. The cost of supporting them would exceed the benefit because they are rarely used, or poorly documented, or have been supplanted by other platforms, or diverge too much from POSIX, or some combination of these and other factors. Please don’t bother sending us patches for them.
Gnulib is divided into modules. Every module implements a single facility. Modules can depend on other modules.
A module consists of a number of files and a module description. The
files are copied by gnulib-tool
into the package that will use it,
usually verbatim, without changes. Source code files (.h, .c files)
reside in the lib/ subdirectory. Autoconf macro files reside in
the m4/ subdirectory. Build scripts reside in the
build-aux/ subdirectory.
The module description contains the list of files; gnulib-tool
copies these files. It contains the module’s
dependencies; gnulib-tool
installs them as well. It also
contains the autoconf macro invocation (usually a single line or
nothing at all); gnulib-tool
ensures this is invoked from the
package’s configure.ac file. And also a Makefile.am
snippet; gnulib-tool
collects these into a Makefile.am
for the tailored Gnulib part. The module description and include file
specification are for documentation purposes; they are combined into
MODULES.html.
The module system serves two purposes:
getopt_long
function—this is a common way to implement parsing
of command line options in a way that complies with the GNU standards—needs
the source code (lib/getopt.c and others), the autoconf macro
which detects whether the system’s libc already has this function (in
m4/getopt.m4), and a few Makefile.am lines that create the
substitute getopt.h if not. These three pieces belong together.
They cannot be used without each other. The module description and
gnulib-tool
ensure that they are copied altogether into the
destination package.
In other words, the module is the elementary unit of code in Gnulib, comparable to a class in object-oriented languages like Java or C#.
The module system is the basis of gnulib-tool
. When
gnulib-tool
copies a part of Gnulib into a package, it first
compiles a module list, starting with the requested modules and adding all
the dependencies, and then collects the files, configure.ac
snippets and Makefile.am snippets.
There are modules of various kinds in Gnulib. For a complete list of the modules, see in MODULES.html.
When a function is not implemented by a system, the Gnulib module provides an implementation under the same name. Examples are the ‘snprintf’ and ‘readlink’ modules.
Similarly, when a function is not correctly implemented by a system, Gnulib provides a replacement. For functions, we use the pattern
#if !HAVE_WORKING_FOO # define foo rpl_foo #endif
and implement the foo
function under the name rpl_foo
. This
renaming is needed to avoid conflicts at compile time (in case the system
header files declare foo
) and at link/run time (because the code
making use of foo
could end up residing in a shared library, and
the executable program using this library could be defining foo
itself).
For header files, such as stdbool.h
or stdint.h
, we provide
the substitute only if the system doesn’t provide a correct one. The
template of this replacement is distributed in a slightly different name,
with ‘.in’ inserted before the ‘.h’ extension, so that on
systems which do provide a correct
header file the system’s one is used.
The modules in this category are supported in C++ mode as well. This means, while the autoconfiguration uses the C compiler, the resulting header files and function substitutes can be used with a matching C++ compiler as well.
These are sometimes POSIX functions with GNU extensions also found in glibc—examples: ‘getopt’, ‘fnmatch’—and often new APIs—for example, for all functions that allocate memory in one way or the other, we have variants which also include the error checking against the out-of-memory condition.
Examples are a module for copying a file—the portability problems
relate to the copying of the file’s modification time, access rights,
and extended attributes—or a module for extracting the tail
component of a file name—here the portability to native Windows
requires a different API than the classical POSIX basename
function.
Examples are an error reporting function, a module that allows output of numbers with K/M/G suffixes, or cryptographic facilities.
Examples are data structures like ‘list’, or abstract output stream
classes that work around the fact that an application cannot implement an
stdio FILE
with its logic. Here, while staying in C, we use
implementation techniques like tables of function pointers, known from the
C++ language or from the Linux kernel.
Examples are the ‘iconv’ module, which interfaces to the
iconv
facility, regardless whether it is contained in libc or in
an external libiconv
. Or the ‘readline’ module, which
interfaces to the GNU readline library.
An example is the ‘maintainer-makefile’ module, which provides extra Makefile tags for maintaining a package.
Gnulib is maintained collaboratively. The mailing list is
<bug-gnulib at gnu dot org>
. Be warned that some people on the
list may be very active at some times and unresponsive at other times.
Every module has one or more maintainers. While issues are discussed collaboratively on the list, the maintainer of a module nevertheless has a veto right regarding changes in his module.
All patches should be posted to the list, regardless whether they are proposed patches or whether they are committed immediately by the maintainer of the particular module. The purpose is not only to inform the other users of the module, but mainly to allow peer review. It is not uncommon that several people contribute comments or spot bugs after a patch was proposed.
Conversely, if you are using Gnulib, and a patch is posted that affects one of the modules that your package uses, you have an interest in proofreading the patch.
Most modules are under the GPL. Some, mostly modules which can reasonably be used in libraries, are under LGPL. Few modules are under other licenses, such as LGPLv2+, unlimited, or public domain.
If the module description file says "GPL", it means "GPLv3+" (GPLv3 or newer, at the licensee’s choice); if it says "LGPL", it means "LGPLv3+" (LGPLv3 or newer, at the licensee’s choice).
The source files, more precisely the files in lib/ and build-aux/, are under a license compatible with the module’s license. Most often, they are under the same license. But files can be shared among several modules, and in these cases it can happen that a source file is under a weaker license than noted in the module description — namely under the weakest license among the licenses of the modules that contain the file.
Different licenses apply to files in special directories:
Module description files are under this copyright:
Copyright © 20XX–20YY Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification, in any medium, are permitted without royalty provided the copyright notice and this notice are preserved.
Autoconf macro files are under this copyright:
Copyright © 20XX–20YY Free Software Foundation, Inc.
This file is free software; the Free Software Foundation gives unlimited permission to copy and/or distribute it, with or without modifications, as long as this notice is preserved.
If a license statement is not present in a test module, the test files are under GPL. Even if the corresponding source module is under LGPL, this is not a problem, since compiled tests are not installed by “make install”.
Documentation files are under this copyright:
Copyright © 2004–20YY Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is at https://www.gnu.org/licenses/fdl-1.3.en.html.
If you want to use some Gnulib modules under LGPL, you can do so by
passing the option ‘--lgpl’ to gnulib-tool
. This will
ensure that all imported modules can be used under the LGPL license.
Similarly, if you want some Gnulib modules
under LGPLv2+ (Lesser GPL version 2.1 or newer), you can do so by
passing the option ‘--lgpl=2’ to gnulib-tool
.
Keep in mind that when you submit patches to files in Gnulib, you should license them under a compatible license. This means that sometimes the contribution will have to be LGPL, if the original file is available under LGPL. You can find out about it by looking at the license header of the file.
Gnulib modules are continually adapted, to match new practices, to be consistent with newly added modules, or simply as a response to build failure reports.
If you are willing to report an occasional regression, we recommend to use the newest version from git always, except in periods of major changes. Most Gnulib users do this.
Gnulib is open in the sense that we gladly accept contributions if they are generally useful, well engineered, and if the contributors have signed the obligatory papers with the FSF.
The module system is open in the sense that a package using Gnulib can
gnulib-tool
.
This is achieved by the ‘--local-dir’ option of gnulib-tool
(see Extending Gnulib).
The gnulib-tool
command is the recommended way to import
Gnulib modules. It is possible to borrow Gnulib modules in a package
without using gnulib-tool
, relying only on the
meta-information stored in the modules/* files, but with a
growing number of modules this becomes tedious. gnulib-tool
simplifies the management of source files, Makefile.ams and
configure.ac in packages incorporating Gnulib modules.
gnulib-tool is not installed in a standard directory that is
contained in the PATH
variable. It needs to be run directly in
the directory that contains the Gnulib source code. You can do this
either by specifying the absolute filename of gnulib-tool, or
you can also use a symbolic link from a place inside your PATH
to the gnulib-tool file of your preferred and most up-to-date
Gnulib checkout, like this:
$ ln -s $HOME/gnu/src/gnulib.git/gnulib-tool $HOME/bin/gnulib-tool
Run ‘gnulib-tool --help’ for information. To get familiar with
gnulib-tool
without affecting your sources, you can also try
some commands with the option ‘--dry-run’; then
gnulib-tool
will only report which actions it would perform in
a real run without changing anything.
gettextize
and autopoint
usersThere are four ways of finding the names of Gnulib modules that you can use in your package:
Gnulib assumes that your project uses Autoconf. When using Gnulib, you will need to have Autoconf among your build tools.
Gnulib also assumes that your project’s configure.ac contains the line
AC_CONFIG_HEADERS([config.h])
The config.h file gets generated with platform dependent C macro definitions, and the source files include it (see Changing your sources for use with Gnulib).
Unless you use gnulib-tool
’s --gnu-make option,
Gnulib also assumes that your project uses Automake at least in a
subdirectory of your project. While the use of Automake in your
project’s top level directory is an easy way to fulfil the Makefile
conventions of the GNU coding standards, Gnulib does not require it.
Invoking ‘gnulib-tool --import’ will copy source files, create a Makefile.am to build them, generate a file gnulib-comp.m4 with Autoconf M4 macro declarations used by configure.ac, and generate a file gnulib-cache.m4 containing the cached specification of how Gnulib is used.
Our example will be a library that uses Autoconf, Automake and
Libtool. It calls strdup
, and you wish to use gnulib to make
the package portable to C99 and C11 (which don’t have strdup
).
~/src/libfoo$ gnulib-tool --import strdup Module list with included dependencies: absolute-header extensions strdup string File list: lib/dummy.c lib/strdup.c lib/string.in.h m4/absolute-header.m4 m4/extensions.m4 m4/gnulib-common.m4 m4/strdup.m4 m4/string_h.m4 Creating directory ./lib Creating directory ./m4 Copying file lib/dummy.c Copying file lib/strdup.c Copying file lib/string.in.h Copying file m4/absolute-header.m4 Copying file m4/extensions.m4 Copying file m4/gnulib-common.m4 Copying file m4/gnulib-tool.m4 Copying file m4/strdup.m4 Copying file m4/string_h.m4 Creating lib/Makefile.am Creating m4/gnulib-cache.m4 Creating m4/gnulib-comp.m4 Finished. You may need to add #include directives for the following .h files. #include <string.h> Don't forget to - add "lib/Makefile" to AC_CONFIG_FILES in ./configure.ac, - mention "lib" in SUBDIRS in Makefile.am, - mention "-I m4" in ACLOCAL_AMFLAGS in Makefile.am, - invoke gl_EARLY in ./configure.ac, right after AC_PROG_CC, - invoke gl_INIT in ./configure.ac. ~/src/libfoo$
By default, the source code is copied into lib/ and the M4
macros in m4/. You can override these paths by using
--source-base=DIRECTORY
and --m4-base=DIRECTORY
. Some
modules also provide other files necessary for building. These files
are copied into the directory specified by ‘AC_CONFIG_AUX_DIR’ in
configure.ac or by the --aux-dir=DIRECTORY
option. If
neither is specified, the current directory is assumed.
gnulib-tool
can make symbolic links instead of copying the
source files. The option to specify for this is ‘--symlink’, or
‘-s’ for short. This can be useful to save a few kilobytes of disk
space. But it is likely to introduce bugs when gnulib
is updated;
it is more reliable to use ‘gnulib-tool --update’ (see below)
to update to newer versions of gnulib
. Furthermore it requires
extra effort to create self-contained tarballs, and it may disturb some
mechanism the maintainer applies to the sources. For these reasons,
this option is generally discouraged.
gnulib-tool
will overwrite any pre-existing files, in
particular Makefile.am. It is also possible to separate the
generated Makefile.am content (for building the gnulib library)
into a separate file, say gnulib.mk, that can be included by your
handwritten Makefile.am, but this is a more advanced use of
gnulib-tool
.
Consequently, it is a good idea to choose directories that are not
already used by your projects, to separate gnulib imported files from
your own files. This approach is also useful if you want to avoid
conflicts between other tools (e.g., gettextize
that also copy
M4 files into your package. Simon Josefsson successfully uses a source
base of gl/, and a M4 base of gl/m4/, in several
packages.
After the ‘--import’ option on the command line comes the list of Gnulib modules that you want to incorporate in your package. The names of the modules coincide with the filenames in Gnulib’s modules/ directory.
Some Gnulib modules depend on other Gnulib modules. gnulib-tool
will automatically add the needed modules as well; you need not list
them explicitly. gnulib-tool
will also memorize which dependent
modules it has added, so that when someday a dependency is dropped, the
implicitly added module is dropped as well (unless you have explicitly
requested that module).
If you want to cut a dependency, i.e., not add a module although one of your requested modules depends on it, you may use the option ‘--avoid=module’ to do so. Multiple uses of this option are possible. Of course, you will then need to implement the same interface as the removed module.
A few manual steps are required to finish the initial import.
gnulib-tool
printed a summary of these steps.
First, you must ensure Autoconf can find the macro definitions in
gnulib-comp.m4. Use the ACLOCAL_AMFLAGS
specifier in
your top-level Makefile.am file, as in:
ACLOCAL_AMFLAGS = -I m4
You are now ready to call the M4 macros in gnulib-comp.m4
from
configure.ac. The macro gl_EARLY
must be called as soon
as possible after verifying that the C compiler is working.
Typically, this is immediately after AC_PROG_CC
, as in:
... AC_PROG_CC gl_EARLY ...
The core part of the gnulib checks are done by the macro
gl_INIT
. Place it further down in the file, typically where
you normally check for header files or functions. It must come after
other checks which may affect the compiler invocation, such as
AC_MINIX
. For example:
... # For gnulib. gl_INIT ...
gl_INIT
will in turn call the macros related with the
gnulib functions, be it specific gnulib macros, like gl_FUNC_ALLOCA
or Autoconf or Automake macros like AC_FUNC_ALLOCA
or
AM_FUNC_GETLINE
. So there is no need to call those macros yourself
when you use the corresponding gnulib modules.
You must also make sure that the gnulib library is built. Add the
Makefile
in the gnulib source base directory to
AC_CONFIG_FILES
, as in:
AC_CONFIG_FILES(... lib/Makefile ...)
You must also make sure that make
will recurse into the gnulib
directory. To achieve this, add the gnulib source base directory to a
SUBDIRS
Makefile.am statement, as in:
SUBDIRS = lib
or if you, more likely, already have a few entries in SUBDIRS
,
you can add something like:
SUBDIRS += lib
Finally, you have to add compiler and linker flags in the appropriate source directories, so that you can make use of the gnulib library. Since some modules (‘getopt’, for example) may copy files into the build directory, top_builddir/lib is needed as well as top_srcdir/lib. For example:
... AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib ... LDADD = lib/libgnu.a ...
Don’t forget to #include
the various header files. In this
example, you would need to make sure that ‘#include <string.h>’
is evaluated when compiling all source code files, that want to make
use of strdup
.
In the usual case where Autoconf is creating a config.h file, you should include config.h first, before any other include file. That way, for example, if config.h defines ‘restrict’ to be the empty string on a non-C99 host, or a macro like ‘_FILE_OFFSET_BITS’ that affects the layout of data structures, the definition is consistent for all include files. Also, on some platforms macros like ‘_FILE_OFFSET_BITS’ and ‘_GNU_SOURCE’ may be ineffective, or may have only a limited effect, if defined after the first system header file is included.
Finally, note that you cannot use AC_LIBOBJ
or
AC_REPLACE_FUNCS
in your configure.ac and expect the
resulting object files to be automatically added to lib/libgnu.a.
This is because your AC_LIBOBJ
and AC_REPLACE_FUNCS
invocations
from configure.ac augment a variable @LIBOBJS@
(and/or
@LTLIBOBJS@
if using Libtool), whereas lib/libgnu.a
is built from the contents of a different variable, usually
@gl_LIBOBJS@
(or @gl_LTLIBOBJS@
if using Libtool).
You can at any moment decide to use Gnulib differently than the last time.
There are two ways to change how Gnulib is used. Which one you’ll use,
depends on where you keep track of options and module names that you pass
to gnulib-tool
.
gnulib-tool
again, with modified options and more or fewer module names.
gnulib-tool
remembers which modules were used last time. If you
want to rely on gnulib-tool
’s own memory of the last used
options and module names, you can use the commands
gnulib-tool --add-import
and
gnulib-tool --remove-import
.
So, if you only want to use more Gnulib modules, simply invoke
gnulib-tool --add-import new-modules
. The list of
modules that you pass after ‘--add-import’ is added to the
previous list of modules.
Similarly, if you want to use fewer Gnulib modules, simply invoke
gnulib-tool --remove-import unneeded-modules
. The list
of modules that you pass after ‘--remove-import’ is removed
from the previous list of modules. Note that if a module is then still
needed as dependency of other modules, it will be used nevertheless.
If you want to really not use a module any more, regardless of
whether other modules may need it, you need to use the ‘--avoid’
option.
For other changes, such as different choices of ‘--lib’, ‘--source-base’ or ‘--aux-dir’, the normal way is to modify manually the file gnulib-cache.m4 in the M4 macros directory, then launch ‘gnulib-tool --add-import’.
The only change for which this doesn’t work is a change of the
‘--m4-base’ directory. Because, when you pass a different value of
‘--m4-base’, gnulib-tool
will not find the previous
gnulib-cache.m4 file any more. A possible solution is to
manually copy the gnulib-cache.m4 into the new M4 macro directory.
In the gnulib-cache.m4 file, the macros have the following meaning:
gl_MODULES
The argument is a space separated list of the requested modules, not including dependencies.
gl_AVOID
The argument is a space separated list of modules that should not be used, even if they occur as dependencies. Corresponds to the ‘--avoid’ command line argument.
gl_SOURCE_BASE
The argument is the relative file name of the directory containing the gnulib source files (mostly *.c and *.h files). Corresponds to the ‘--source-base’ command line argument.
gl_M4_BASE
The argument is the relative file name of the directory containing the gnulib M4 macros (*.m4 files). Corresponds to the ‘--m4-base’ command line argument.
gl_TESTS_BASE
The argument is the relative file name of the directory containing the gnulib unit test files. Corresponds to the ‘--tests-base’ command line argument.
gl_LIB
The argument is the name of the library to be created. Corresponds to the ‘--lib’ command line argument.
gl_LGPL
The presence of this macro without arguments corresponds to the ‘--lgpl’ command line argument. The presence of this macro with an argument (whose value must be 2 or 3) corresponds to the ‘--lgpl=arg’ command line argument.
gl_LIBTOOL
The presence of this macro corresponds to the ‘--libtool’ command line argument and to the absence of the ‘--no-libtool’ command line argument. It takes no arguments.
gl_MACRO_PREFIX
The argument is the prefix to use for macros in the gnulib-comp.m4 file. Corresponds to the ‘--macro-prefix’ command line argument.
When you want to update to a more recent version of Gnulib, without changing the list of modules or other parameters, a simple call does it:
$ gnulib-tool --add-import
This will create, update or remove files, as needed.
Note: From time to time, changes are made in Gnulib that are not backward compatible. When updating to a more recent Gnulib, you should consult Gnulib’s NEWS file to check whether the incompatible changes affect your project.
Gnulib contains some header file overrides. This means that when building on systems with deficient header files in /usr/include/, it may create files named string.h, stdlib.h, stdint.h or similar in the build directory. In the other source directories of your package you will usually pass ‘-I’ options to the compiler, so that these Gnulib substitutes are visible and take precedence over the files in /usr/include/.
These Gnulib substitute header files rely on <config.h> being already included. Furthermore <config.h> must be the first include in every compilation unit. This means that to all your source files and likely also to all your tests source files you need to add an ‘#include <config.h>’ at the top. Which source files are affected? Exactly those whose compilation includes a ‘-I’ option that refers to the Gnulib library directory.
This is annoying, but inevitable: On many systems, <config.h> is
used to set system dependent flags (such as _GNU_SOURCE
on GNU systems),
and these flags have no effect after any system header file has been included.
When you use Gnulib, you need to augment the set of libraries against which
your programs and libraries are linked. This is done by augmenting the
Automake variable LDADD
(for all programs) or
prog_LDADD
(for a single program prog
) or
library_la_LIBADD
(for a single library library.la
).
What do you need to add to this Automake variable?
lib/libgnu.a
for source in the
top-level directory, or ../lib/libgnu.a
for source in a sibling
directory of lib/
.
gnulib-tool
. Alternatively,
you can retrieve the set of additional libraries required by a specific
Gnulib module by running
./gnulib-tool --extract-recursive-link-directive module
Beware: By looking into the module description file modules/module
or by running
./gnulib-tool --extract-link-directive module
you would miss the link dependencies of indirectly used modules.
Gnulib contains a wealth of portability workarounds for ISO C and POSIX functions. They are listed in detail in the chapter ISO C and POSIX Function Substitutes. If you want to know which function substitutes are recommended for your package, you can search your source code for ISO C and POSIX functions that it uses and read the corresponding sections of said documentation chapter. But this is a tedious task. Here is an alternative approach that makes this task easier.
make distclean
if you previously built in the top-level directory.
Then regenerate the Autotools-generated parts of the package.
make distclean
.
In some cases, you may want to set additional compiler options for
use within the Gnulib import directory. For example, the
‘relocatable’ module operates better if you define the C macros
ENABLE_COSTLY_RELOCATABLE
and INSTALLDIR
during its
compilation.
There are two ways to do so: Use of the gnulib-tool
option
--makefile-name
, and a kitchen-sink module.
With the gnulib-tool
option --makefile-name
, you are
telling gnulib-tool
to generate an includable Makefile.am
portion, rather than a self-contained Makefile.am
. For example,
when you use --makefile-name=Makefile.gnulib
, gnulib-tool
will generate Makefile.gnulib
, and you will provide a
hand-written Makefile.am
that includes Makefile.gnulib
through a line such as
include Makefile.gnulib
Before this include, you need to initialize this set of Makefile.am
variables:
AUTOMAKE_OPTIONS
SUBDIRS
noinst_HEADERS
noinst_LIBRARIES
noinst_LTLIBRARIES
pkgdata_DATA
(only with Automake ≥ 1.11.4)
EXTRA_DIST
BUILT_SOURCES
SUFFIXES
MOSTLYCLEANFILES
MOSTLYCLEANDIRS
CLEANFILES
DISTCLEANFILES
MAINTAINERCLEANFILES
AM_CPPFLAGS
AM_CFLAGS
AUTOMAKE_OPTIONS
should be initialized as described in
Changing Automake’s Behavior in GNU Automake.
The other variables can be initialized to empty. However, you will most
likely want to initialize some of them with non-empty values, in order
to achieve the desired customization.
The other approach, the kitchen-sink module, is more advanced. See chapter Extending Gnulib.
Your project might build both a library and some accompanying programs
in the same source tree. In that case you might want to use different
modules for the library than for the programs. Typically the programs
might want to make use of getopt-posix
or version-etc
,
while the library wants to stay clear of these modules for technical
or licensing reasons.
Let’s assume that your project contains a lib directory where the source of the library resides and a src directory for the sources of the programs as follows.
. |-- configure.ac |-- lib | |-- foo.c | `-- Makefile.am |-- Makefile.am `-- src |-- bar.c `-- Makefile.am
You can now add two instances of Gnulib to your project in separate source trees:
~/src/libfoo$ gnulib-tool --import --lib=libgnu --source-base=gnulib \ --m4-base=gnulib/m4 --macro-prefix=gl strndup ~/src/libfoo$ gnulib-tool --import --lib=libgnutools \ --source-base=src/gnulib --m4-base=src/gnulib/m4 \ --macro-prefix=gl_tools getopt-gnu
The first one will import the module strndup
in gnulib
and the second one will import getopt-gnu
in src/gnulib
and you will end up with the following source tree (many files omitted
in the interest of brevity):
. |-- configure.ac |-- gnulib | |-- m4 | |-- strndup.c |-- lib | |-- foo.c | `-- Makefile.am |-- Makefile.am `-- src |-- bar.c |-- gnulib | |-- getopt.c | |-- getopt.in.h | |-- m4 `-- Makefile.am
As discussed in Bundling the unit tests of the Gnulib modules, you may not use ‘--with-tests’
for this project since the configure.ac
is shared.
Integration with your code is basically the same as outlined in
Initial import with the one exception that you have to add both
the macro gl_EARLY
and the macro gl_tools_EARLY
to your
configure.ac (and of course also both macros gl_INIT
and
gl_tools_INIT
). Obviously the name of the second macro is
dependent on the value of the --macro-prefix option in your
gnulib-tool
invocation.
... AC_PROG_CC gl_EARLY gl_tools_EARLY ... # For gnulib. gl_INIT gl_tools_INIT ...
Also as outlined in Initial import you will have to add compiler and linker flags. For the library you might have to add something along the line of the following to your Makefile.am:
... AM_CPPFLAGS = -I$(top_srcdir)/gnulib -I$(top_builddir)/gnulib ... libfoo_la_LIBADD = $(top_builddir)/gnulib/libgnu.la ...
Correspondingly for the programs you will have to add something like this:
... AM_CPPFLAGS = -I$(top_srcdir)/src/gnulib -I$(top_builddir)/src/gnulib ... LDADD = $(top_builddir)/src/gnulib/libgnutools.la ...
The name of the library that you have pass in the linker option
depends on the --lib option in gnulib-tool
invocation.
gettextize
and autopoint
usersThe programs gettextize
and autopoint
, part of
GNU gettext
, import or update the internationalization infrastructure.
Some of this infrastructure, namely ca. 20 Autoconf macro files and the
config.rpath file, is also contained in Gnulib and may be imported
by gnulib-tool
. The use of gettextize
or autopoint
will therefore overwrite some of the files that gnulib-tool
has
imported, and vice versa.
Avoiding to use gettextize
(manually, as package maintainer) or
autopoint
(as part of a script like autoreconf
or
autogen.sh
) is not the solution: These programs also import the
infrastructure in the po/ and optionally in the intl/ directory.
The copies of the conflicting files in Gnulib are more up-to-date than
the copies brought in by gettextize
and autopoint
. When a
new gettext
release is made, the copies of the files in Gnulib will
be updated immediately.
The choice of which version of gettext to require depends on the needs of your package. For a package that wants to comply to GNU Coding Standards, the steps are:
gettextize
, always use the gettextize
from the
matching GNU gettext release. For the most recent Gnulib checkout, this is
the newest release found on https://ftp.gnu.org/gnu/gettext/. For an
older Gnulib snapshot, it is the release that was the most recent release
at the time the Gnulib snapshot was taken.
gettextize
, invoke gnulib-tool
and import
the gettext
module. Also, copy the latest version of gnulib’s
build-aux/po/Makefile.in.in to your po/ directory (this
is done for you if you use gnulib’s bootstrap script).
*** error: gettext infrastructure mismatch:
using a Makefile.in.in from gettext version ...
but the Autoconf macros are from gettext version ...
,
it means that a new GNU gettext release was made, and its Autoconf macros
were integrated into Gnulib and now mismatch the po/ infrastructure.
In this case, fetch and install the new GNU gettext release and run
gettextize
followed by gnulib-tool
.
On the other hand, if your package is not as concerned with compliance to the latest standards, but instead favors development on stable environments, the steps are:
gettext
that you intend to
support during development (at this time, gnulib recommends going no
older than version 0.17). Run autopoint
(not
gettextize
) to copy infrastructure into place (newer versions
of gettext will install the older infrastructure that you requested).
gnulib-tool
, and import the gettext-h
module.
Regardless of which approach you used to get the infrastructure in place, the following steps must then be used to preserve that infrastructure (gnulib’s bootstrap script follows these rules):
autopoint
, invoke gnulib-tool
afterwards.
autoreconf
after gnulib-tool
, make sure to
not invoke autopoint
a second time, by setting the AUTOPOINT
environment variable, like this:
$ env AUTOPOINT=true autoreconf --install
Gnulib provides some functions that emit translatable messages using GNU
gettext
. The ‘gnulib’ domain at the
Translation Project collects
translations of these messages, which you should incorporate into your
own programs.
There are two basic ways to achieve this. The first, and older, method is to list all the source files you use from Gnulib in your own po/POTFILES.in file. This will cause all the relevant translatable strings to be included in your POT file. When you send this POT file to the Translation Project, translators will normally fill in the translations of the Gnulib strings from their “translation memory”, and send you back updated PO files.
However, this process is error-prone: you might forget to list some source files, or the translator might not be using a translation memory and provide a different translation than another translator, or the translation might not be kept in sync between Gnulib and your package. It is also slow and causes substantial extra work, because a human translator must be in the loop for each language and you will need to incorporate their work on request.
For these reasons, a new method was designed and is now recommended. If
you pass the --po-base=directory
and --po-domain=domain
options to gnulib-tool
, then gnulib-tool
will create a
separate directory with its own POTFILES.in, and fetch current
translations directly from the Translation Project (using
rsync
or wget
, whichever is available).
The POT file in this directory will be called
domain-gnulib.pot, depending on the domain you gave to the
--po-domain
option (typically the same as the package name).
This causes these translations to reside in a separate message domain,
so that they do not clash either with the translations for the main part
of your package nor with those of other packages on the system that use
possibly different versions of Gnulib.
When you use these options, the functions in Gnulib are built
in such a way that they will always use this domain regardless of the
default domain set by textdomain
.
In order to use this method, you must—in each program that might use Gnulib code—add an extra line to the part of the program that initializes locale-dependent behavior. Where you would normally write something like:
setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE);
you should add an additional bindtextdomain
call to inform
gettext of where the MO files for the extra message domain may be found:
bindtextdomain (PACKAGE "-gnulib", LOCALEDIR);
(This example assumes that the domain that you specified
to gnulib-tool
is the same as the value of the PACKAGE
preprocessor macro.)
Since you do not change the textdomain
call, the default message
domain for your program remains the same and your own use of gettext
functions will not be affected.
If a project stores its source files in a version control system (VCS), such as CVS, Subversion, or Git, one needs to decide which files to commit.
In principle, all files created by gnulib-tool
, except
gnulib-cache.m4, can be treated like generated source files,
like for example a parser.c file generated from
parser.y. Alternatively, they can be considered source files
and updated manually.
Here are the three different approaches in common use. Each has its place, and you should use whichever best suits your particular project and development methods.
gnulib-tool
generated files should all be
committed. In this case, you should pass the option
‘--no-vc-files’ to gnulib-tool
, which avoids alteration of
VCS-related files such as .gitignore.
Gnulib also contains files generated by make
(and removed by
make clean
), using information determined by
configure
. For a Gnulib source file of the form
lib/foo.in.h, the corresponding lib/foo.h is such a
make
-generated file. These should not be checked
into the VCS, but instead added to .gitignore or equivalent.
gnulib-tool
. The command for restoring the omitted files
depends on it:
gnulib-cache.m4
, such as
autogen.sh, bootstrap, bootstrap.conf, or similar,
the restoration command is the entire gnulib-tool ... --import ...
invocation with all options and module names.
gnulib-tool
’s memory of the last used
options and module names, then the file gnulib-cache.m4 in the M4
macros directory must be added to the VCS, and the restoration command
is:
$ gnulib-tool --update
The ‘--update’ option operates much like the ‘--add-import’ option, but it does not offer the possibility to change the way Gnulib is used. Also it does not report in the ChangeLogs the files that it had to add because they were missing.
Gnulib includes the file build-aux/bootstrap to aid a developer in using this setup. Furthermore, in projects that use git for version control, it is possible to use a git submodule containing the precise commit of the gnulib repository, so that each developer running bootstrap will get the same version of all gnulib-provided files. The location of the submodule can be chosen to fit the package’s needs; here’s how to initially create the submodule in the directory .gnulib:
$ dir=.gnulib $ git submodule add -- https://git.savannah.gnu.org/git/gnulib.git $dir $ git config alias.syncsub "submodule foreach git pull origin master"
Thereafter, bootstrap can run this command to update the submodule to the recorded checkout level:
git submodule update --init $dir
and a developer can use this sequence to update to a newer version of gnulib:
$ git syncsub $ git add $dir $ ./bootstrap
Makefile.in
generated by Automake. This
increases the size and complexity of the repository, but can help
occasional contributors by not requiring them to have a full Gnulib
checkout to do a build, and all developers by ensuring that all
developers are working with the same version of Gnulib in the
repository. It also supports multiple Gnulib instances within a
project. It remains important not to commit the
make
-generated files, as described above.
You can bundle the unit tests of the Gnulib modules together with your
package, through the ‘--with-tests’ option. Together with
‘--with-tests’, you also specify the directory for these tests
through the ‘--tests-base’ option. Of course, you need to add this
directory to the SUBDIRS
variable in the Makefile.am
of
the parent directory.
The advantage of having the unit tests bundled is that when your program has a problem on a particular platform, running the unit tests may help determine quickly if the problem is on Gnulib’s side or on your package’s side. Also, it helps verifying Gnulib’s portability, of course.
The unit tests will be compiled and run when the user runs ‘make check’. When the user runs only ‘make’, the unit tests will not be compiled.
In the SUBDIRS
variable, it is useful to put the Gnulib tests directory
after the directory containing the other tests, not before:
SUBDIRS = gnulib-lib src man tests gnulib-tests
This will ensure that on platforms where there are test failures in either directory, users will see and report the failures from the tests of your program.
Note: In packages which use more than one invocation of gnulib-tool
in the scope of the same configure.ac
, you cannot use
‘--with-tests’. You will have to use a separate configure.ac
in this case.
In some cases, a module is needed by another module only on specific
platforms. But when a module is present, its Autoconf checks are always
executed, and its Makefile.am
additions are always enabled. So
it can happen that some Autoconf checks are executed and some source files
are compiled, although no other module needs them on this particular
platform, just in case some other module would need them.
The option ‘--conditional-dependencies’ enables an optimization of
configure checks and Makefile.am
snippets that avoids this. With
this option, whether a module is considered “present” is no longer decided
when gnulib-tool
is invoked, but later, when configure
is run.
This applies to modules that were added as dependencies while
gnulib-tool
was run; modules that were passed on the command line
explicitly are always “present”.
For example, the timegm
module needs, on platforms
where the system’s timegm
function is missing or buggy, a replacement
that is based on a function mktime_internal
. The module
mktime-internal
that provides this function provides it on all
platforms. So, by default, the file mktime-internal.c will be
compiled on all platforms, even on glibc and BSD systems which have a
working timegm
function. When the option
‘--conditional-dependencies’ is given, on the other hand, and if
mktime-internal
was not explicitly required on the command line,
the file mktime-internal.c will only be compiled on the platforms
where the timegm
needs them.
Conditional dependencies are specified in the module description by putting
the condition on the same line as the dependent module, enclosed in brackets.
The condition is a boolean shell expression that can assume that the
configure.ac
snippet from the module description has already been
executed. In the example above, the dependency from timegm
to
mktime-internal
is written like this:
Depends-on: ... mktime-internal [test $HAVE_TIMEGM = 0 || test $REPLACE_TIMEGM = 1] ...
Note: The option ‘--conditional-dependencies’ cannot be used together
with the option ‘--with-tests’. It also cannot be used when a package
uses gnulib-tool
for several subdirectories, with different values
of ‘--source-base’, in the scope of a single configure.ac
file.
This chapter explains how to write modules of your own, either to extend Gnulib for your own package (see Extending Gnulib), or for inclusion in gnulib proper.
The guidelines in this chapter do not necessarily need to be followed for
using gnulib-tool
. They merely represent a set of good practices.
Following them will result in a good structure of your modules and in
consistency with gnulib.
AC_LIBOBJ
Every API (C functions or variables) provided should be declared in a header file (.h file) and implemented in one or more implementation files (.c files). The separation has the effect that users of your module need to read only the contents of the .h file and the module description in order to understand what the module is about and how to use it—not the entire implementation. Furthermore, users of your module don’t need to repeat the declarations of the functions in their code, and are likely to receive notification through compiler errors if you make incompatible changes to the API (like, adding a parameter or changing the return type of a function).
The .h file should declare the C functions and variables that the module provides.
The .h file should be stand-alone. That is, it does not require other .h files to be included before. Rather, it includes all necessary .h files by itself.
It is a tradition to use CPP tricks to avoid parsing the same header file more than once, which might cause warnings. The trick is to wrap the content of the header file (say, foo.h) in a block, as in:
#ifndef FOO_H # define FOO_H ... body of header file goes here ... #endif /* FOO_H */
Whether to use FOO_H
or _FOO_H
is a matter of taste and
style. The C99 and C11 standards reserve all identifiers that begin with an
underscore and either an uppercase letter or another underscore, for
any use. Thus, in theory, an application might not safely assume that
_FOO_H
has not already been defined by a library. On the other
hand, using FOO_H
will likely lead the higher risk of
collisions with other symbols (e.g., KEY_H
, XK_H
, BPF_H
,
which are CPP macro constants, or COFF_LONG_H
, which is a CPP
macro function). Your preference may depend on whether you consider
the header file under discussion as part of the application (which has
its own namespace for CPP symbols) or a supporting library (that
shouldn’t interfere with the application’s CPP symbol namespace).
Adapting C header files for use in C++ applications can use another CPP trick, as in:
# ifdef __cplusplus extern "C" { # endif ... body of header file goes here ... # ifdef __cplusplus } # endif
The idea here is that __cplusplus
is defined only by C++
implementations, which will wrap the header file in an ‘extern "C"’
block. Again, whether to use this trick is a matter of taste and
style. While the above can be seen as harmless, it could be argued
that the header file is written in C, and any C++ application using it
should explicitly use the ‘extern "C"’ block itself. Your
preference might depend on whether you consider the API exported by
your header file as something available for C programs only, or for C
and C++ programs alike.
Note that putting a #include
in an extern "C" { ... }
block yields a syntax error in C++ mode on some platforms (e.g., glibc
systems with g++ v3.3 to v4.2, AIX, IRIX). For this reason, it
is recommended to place the #include
before the extern
"C"
block.
The .c file or files implement the functions and variables declared in the .h file.
Every implementation file must start with ‘#include <config.h>’.
This is necessary for activating the preprocessor macros that are defined
on behalf of the Autoconf macros. Some of these preprocessor macros,
such as _GNU_SOURCE
, would have no effect if defined after a system
header file has already been included.
Then comes the ‘#include "..."’ specifying the header file that is being implemented. Putting this right after ‘#include <config.h>’ has the effect that it verifies that the header file is self-contained.
Then come the system and application headers. It is customary to put all the system headers before all application headers, so as to minimize the risk that a preprocessor macro defined in an application header confuses the system headers on some platforms.
In summary:
The specification of a function should answer at least the following questions:
Where to put the specification describing exported functions? Three practices are used in gnulib:
In any case, the specification should appear in just one place, unless you can ensure that the multiple copies will always remain identical.
The advantage of putting it in the header file is that the user only has to read the include file normally never needs to peek into the implementation file(s).
The advantage of putting it in the implementation file is that when reviewing or changing the implementation, you have both elements side by side.
The advantage of texinfo formatted documentation is that it is easily published in HTML or Info format.
Currently (as of 2020), 70% of gnulib uses the first practice, 25% of gnulib uses the second practice, and a small minority uses the texinfo practice.
For the module description, you can start from an existing module’s description, or from a blank one: module/TEMPLATE for a normal module, or module/TEMPLATE-TESTS for a unit test module. Some more fields are possible but rarely used. Use module/TEMPLATE-EXTENDED if you want to use one of them.
Module descriptions have the following fields. Absent fields are equivalent to fields with empty contents.
This field should contain a concise description of the module’s functionality. One sentence is enough. For example, if it defines a single function ‘frob’, the description can be ‘frob() function: frobnication.’ Gnulib’s documentation generator will automatically convert the first part to a hyperlink when it has this form.
This field is either empty/absent, or contains the word ‘obsolete’. In
the latter case, gnulib-tool
will, unless the option
--with-obsolete
is given, omit it when it used as a dependency. It is
good practice to also notify the user about an obsolete module. This is done
by putting into the ‘Notice’ section (see below) text like
‘This module is obsolete.’
This field contains text that gnulib-tool
will show to the user
when the module is used. This can be a status indicator like
‘This module is obsolete.’ or additional advice. Do not abuse this
field.
This field is either empty/absent, or contains the word ‘all’. It
describes to which Makefile.am
the module is applied. By default,
a normal module is applied to source_base/Makefile.am
(normally lib/Makefile.am
), whereas a module ending in -tests
is applied to tests_base/Makefile.am
(normally
tests/Makefile.am
). If this field is ‘all’, it is applied to
both Makefile.am
s. This is useful for modules which provide
Makefile.am macros rather than compiled source code.
This field contains a newline separated list of the files that are part of
the module. gnulib-tool
copies these files into the package that
uses the module.
This list is typically ordered by importance: First comes the header file, then the implementation files, then other files.
It is possible to have the same file mentioned in multiple modules. That is, if the maintainers of that module agree on the purpose and future of said file.
This field contains a newline separated list of the modules that are required
for the proper working of this module. gnulib-tool
includes each
required module automatically, unless it is specified with option
--avoid
or it is marked as obsolete and the option
--with-obsolete
is not given.
A test modules foo-tests
implicitly depends on the corresponding non-test
module foo
. foo
implicitly depends on foo-tests
if the
latter exists and if the option --with-tests
has been given.
Tests modules can depend on non-tests modules. Non-tests modules should not depend on tests modules. (Recall that tests modules are built in a separate directory.)
Each listed required module may be declared a conditional dependency. This
is indicated by placing the condition for the dependency on the same line,
enclosed in brackets, after the name of the required module. The condition
is a shell expression that is run after the module’s configure.ac
statements. For example:
strtoull [test $ac_cv_func_strtoumax = no]
Lines starting with #
are recognized as comments and are ignored.
This field contains configure.ac stuff (Autoconf macro invocations and
shell statements) that are logically placed early in the configure.ac
file: right after the AC_PROG_CC
invocation. This section is adequate
for statements that modify CPPFLAGS
, as these can affect the results of
other Autoconf macros.
This field contains configure.ac stuff (Autoconf macro invocations and shell statements).
It is forbidden to add items to the CPPFLAGS
variable here, other than
temporarily, as these could affect the results of other Autoconf macros.
We avoid adding items to the LIBS
variable, other than temporarily.
Instead, the module can export an Autoconf-substituted variable that contains
link options. The user of the module can then decide to which executables
to apply which link options. Recall that a package can build executables of
different kinds and purposes; having all executables link against all
libraries is inappropriate.
If the statements in this section grow larger than a couple of lines, we
recommend moving them to a .m4
file of their own.
This field contains Makefile.am
statements. Variables like
lib_SOURCES
are transformed to match the name of the library
being built in that directory. For example, lib_SOURCES
may become
libgnu_a_SOURCES
(for a plain library) or libgnu_la_SOURCES
(for a libtool library). Therefore, the normal way of having an
implementation file lib/foo.c
compiled unconditionally is to write
lib_SOURCES += foo.c
This field contains the preprocessor statements that users of the module need to add to their source code files. Typically it’s a single include statement. A shorthand is allowed: You don’t need to write the word “#include”, just the name of the include file in the way it will appear in an include statement. Example:
"foo.h"
This field contains the set of libraries that are needed when linking
libraries or executables that use this module. Often this will be
written as a reference to a Makefile variable. Please write them
one per line, so that gnulib-tool
can remove duplicates
when presenting a summary to the user.
Example:
$(POW_LIBM) $(LTLIBICONV) when linking with libtool, $(LIBICONV) otherwise
When this field is omitted, it defaults to the union of the Link
field of the dependencies.
This field specifies the license that governs the source code parts of this module. See Copyright for details. Be sure to place, in every source code file, a copyright notice and the appropriate license notice, taken from the etc/license-notices/ directory.
This field specifies the persons who have a definitive say about proposed
changes to this module. You don’t need to mention email addresses here:
they can be inferred from the ChangeLog
file.
Please put at least one person here. We don’t like unmaintained modules.
For a module foo
, an Autoconf macro file m4/foo.m4 is typically
created when the Autoconf macro invocations for the module are longer than
one or two lines.
The name of the main entry point into this Autoconf macro file is typically
gl_FOO
. For modules outside Gnulib that are not likely to be moved
into Gnulib, please use a prefix specific to your package: gt_
for
GNU gettext, cu_
for GNU coreutils, etc.
For modules that define a function foo
, the entry point is called
gl_FUNC_FOO
instead of gl_FOO
. For modules that provide a
header file with multiple functions, say foo.h
, the entry point is
called gl_FOO_H
or gl_HEADER_FOO_H
. This convention is useful
because sometimes a header and a function name coincide (for example,
fcntl
and fcntl.h
).
For modules that provide a replacement, it is useful to split the Autoconf
macro into two macro definitions: one that detects whether the replacement
is needed and requests the replacement by setting a HAVE_FOO
variable to 0 or a REPLACE_FOO
variable to 1 (this is the
entry point, say gl_FUNC_FOO
), and one that arranges for the macros
needed by the replacement code lib/foo.c
(typically called
gl_PREREQ_FOO
). The reason of this separation is
lib/foo.c
, all you have to review
is the Depends-on
section of the module description and the
gl_PREREQ_FOO
macro in the Autoconf macro file.
AC_LIBOBJ
Source files that provide a replacement should be only compiled on the
platforms that need this replacement. While it is actually possible
to compile a .c
file whose contents is entirely #ifdef
’ed
out on the platforms that don’t need the replacement, this practice is
discouraged because
.o
file that suggests that a replacement was needed.
The typical idiom for invoking AC_LIBOBJ
is thus the following,
in the module description:
if test $HAVE_FOO = 0 || test $REPLACE_FOO = 1; then AC_LIBOBJ([foo]) gl_PREREQ_FOO fi
Important: Do not place AC_LIBOBJ
invocations in the Autoconf
macros in the m4/
directory. The purpose of the Autoconf macros
is to determine what features or bugs the platform has, and to make
decisions about which replacements are needed. The purpose of the
configure.ac
and Makefile.am
sections of the module
descriptions is to arrange for the replacements to be compiled.
Source file names do not belong in the m4/
directory.
When an AC_LIBOBJ
invocation is unconditional, it is simpler
to just have the source file compiled through an Automake variable
augmentation: In the Makefile.am
section write
lib_SOURCES += foo.c
When a module description contains an AC_LIBOBJ([foo])
invocation, you must list the source file lib/foo.c
in the Files
section. This is needed even if the module
depends on another module that already lists lib/foo.c
in its
Files
section — because your module might be used among
the test modules (in the directory specified through ‘--tests-base’)
and the other module among the main modules (in the directory specified
through ‘--source-base’), and in this situation, the
AC_LIBOBJ([foo])
of your module can only be satisfied by having
foo.c
be present in the tests source directory as well.
A unit test that is a simple C program usually has a module description as simple as this:
Files: tests/test-foo.c tests/macros.h Depends-on: configure.ac: Makefile.am: TESTS += test-foo check_PROGRAMS += test-foo
The test program tests/test-foo.c often has the following structure:
ASSERT
macro.
The body of the test, then, contains many ASSERT
invocations. When
a test fails, the ASSERT
macro prints the line number of the failing
statement, thus giving you, the developer, an idea of which part of the test
failed, even when you don’t have access to the machine where the test failed
and the reporting user cannot run a debugger.
Sometimes it is convenient to write part of the test as a shell script. (For example, in areas related to process control or interprocess communication, or when different locales should be tried.) In these cases, the typical module description is like this:
Files: tests/test-foo.sh tests/test-foo.c tests/macros.h Depends-on: configure.ac: Makefile.am: TESTS += test-foo.sh TESTS_ENVIRONMENT += FOO_BAR='@FOO_BAR@' check_PROGRAMS += test-foo
Here, the TESTS_ENVIRONMENT
variable can be used to pass values
determined by configure
or by the Makefile
to the shell
script, as environment variables. The Autoconf values EXEEXT
and srcdir
are already provided as environment variables,
through an initial value of TESTS_ENVIRONMENT
that
gnulib-tool
puts in place.
Regardless of the specific form of the unit test, the following guidelines should be respected:
ASSERT
macro already does so.
fputs ("Skipping test: multithreading not enabled\n", stderr); return 77;
Such a message helps detecting bugs in the autoconf macros: A simple message ‘SKIP: test-foo’ does not sufficiently catch the attention of the user.
Incompatible changes to Gnulib modules should be mentioned in Gnulib’s NEWS file. Incompatible changes here mean that existing source code may not compile or work any more.
We don’t mean changes in the binary interface (ABI), since
Gnulib modules are intended to be suitable for widespread use. Most problems with Gnulib can and should be fixed in a generic way, so that all of Gnulib’s users can benefit from the change. But occasionally a problem arises that is difficult or undesirable to fix generically, or a project that uses Gnulib may need to work around an issue before the Gnulib maintainers commit a final fix. Maintainers may also want to add their own pools of modules to projects as Gnulib “staging areas.”
The obvious way to make local changes to Gnulib modules is to use
gnulib-tool
to check out pristine modules, then to modify
the results in-place. This works well enough for short-lived
experiments. It is harder to keep modified versions of Gnulib modules
for a long time, even though Git (or another distributed version
control systems) can help out a lot with this during the development
process.
Git, however, doesn’t address the distribution issue. When a package
“foobar” needs a modified version of, say, stdint.in.h, it
either has to put a comment into foobar/autogen.sh saying
“Attention! This doesn’t work with a pristine Gnulib, you need this
and that patch after checking out Gnulib,” or it has to use the
‘--avoid=stdint’ option and provide the modified stdint
module in a different directory.
The --local-dir option to gnulib-tool
solves this
problem. It allows the package to override or augment Gnulib. This
means:
gnulib-tool
option --makefile-name.)
In a release tarball, you can distribute the contents of this --local-dir directory that will be combinable with newer versions of Gnulib, barring incompatible changes to Gnulib.
If the --local-dir=directory option is specified, then
gnulib-tool
looks in directory whenever it
reads a file from the Gnulib directory. Suppose gnulib-tool
is looking for file. Then:
gnulib-tool
uses
it instead of the file included in Gnulib.
gnulib-tool
uses the file from Gnulib after applying the diff
using the patch
program.
gnulib-tool
uses the file included in Gnulib.
You can specify the --local-dir multiple times. In this case, the first specified directory has the highest precedence. That is, a file found in one directory will shadow any file and file.diff in the later directories and in the Gnulib directory. And a file file.diff found in one directory will be applied on top of the combination of file and file.diff files found in the later directories and in the Gnulib directory.
Please make wise use of this option. It also allows you to easily hold back modifications you make to Gnulib macros in cases it may be better to share them.
The gnulib API does not have a standard error code for the out of memory error condition. Instead of adding a non-standard error code, gnulib has chosen to adopt a different strategy. Out of memory handling happens in rare situations, but performing the out of memory error handling after almost all API function invocations pollute your source code and might make it harder to spot more serious problems. The strategy chosen improves code readability and robustness.
For most applications, aborting the application with an error message when the out of memory situation occurs is the best that can be wished for. This is how the library behaves by default (using the ‘xalloc-die’ module).
However, we realize that some applications may not want to abort
execution in any situation. Gnulib supports a hook to let the
application regain control and perform its own cleanups when an out of
memory situation has occurred. The application can define a function
(having a void
prototype, i.e., no return value and no
parameters) and set the library variable
xalloc_die
to that function. The variable should be
declared as follows.
extern void (*xalloc_die) (void);
Gnulib will invoke this function if an out of memory error occurs. Note that the function should not return. Of course, care must be taken to not allocate more memory, as that will likely also fail.
Modules can be marked obsolete. This means that the problems they fix
don’t occur any more on the platforms that are reasonable porting targets
now. gnulib-tool
warns when obsolete modules are mentioned on the
command line, and by default ignores dependencies from modules to obsolete
modules. When you pass the option --with-obsolete
to
gnulib-tool
, dependencies to obsolete modules will be included,
however, unless blocked through an --avoid
option. This option
is useful if your package should be portable even to very old platforms.
In order to mark a module obsolete, you need to add this to the module description:
Status: obsolete Notice: This module is obsolete.
Test modules can be marked with some special status attributes. When a
test module has such an attribute, gnulib-tool --import
will not
include it by default.
The supported status attributes are:
c++-test
Indicates that the test is testing C++ interoperability. Such a test is useful in a C++ or mixed C/C++ package, but is useless in a C package.
longrunning-test
Indicates that the test takes a long time to compile or execute (more than five minutes or so). Such a test is better avoided in a release that is made for the general public.
privileged-test
Indicates that the test will request special privileges, for example, ask for the superuser password. Such a test may hang when run non-interactively and is therefore better avoided in a release that is made for the general public.
unportable-test
Indicates that the test is known to fail on some systems, and that there is no workaround about it. Such a test is better avoided in a release that is made for the general public.
gnulib-tool --import --with-tests
will not include tests marked with
these attributes by default. When gnulib-tool
is invoked with one
of the options --with-c++-tests
, --with-longrunning-tests
,
--with-privileged-tests
, --with-unportable-tests
, it
will include tests despite the corresponding special status attribute.
When gnulib-tool
receives the option --with-all-tests
,
it will include all tests regardless of their status attributes.
gnulib-tool --create-testdir --with-tests
and
gnulib-tool --create-megatestdir --with-tests
by default include all
tests of modules specified on the command line, regardless of their status
attributes. Tests of modules occurring as dependencies are not included
by default if they have one of these status attributes. The options
--with-c++-tests
, --with-longrunning-tests
,
--with-privileged-tests
, --with-unportable-tests
are
recognized here as well. Additionally, gnulib-tool
also
understands the options --without-c++-tests
,
--without-longrunning-tests
, --without-privileged-tests
,
--without-unportable-tests
.
In order to mark a module with a status attribute, you need to add it to the module description, like this:
Status: longrunning-test
If only a part of a test deserves a particular status attribute, you
can split the module into a primary and a secondary test module,
say foo-tests
and foo-extra-tests
. Then add a dependency
from foo-tests
to foo-extra-tests
, and mark the
foo-extra-tests
with the particular status attribute.
The normal way to design modules is that each module has its own code, and the module dependencies provide the facilities on which this code can rely. But sometimes it is necessary to use more advanced techniques. For example:
n
against zero when you call malloc (n)
.
Be aware that these advanced techniques likely cause breakage in the
situation of multiple gnulib-tool
invocations in the scope of a
single configure
file. This is because the question “is module
B present?” does not have a unique answer in such situations.
gnulib-tool
has support for these techniques in the situation of
--create-testdir --single-configure
, which basically has two
gnulib-tool
invocations, one for a set of modules that end up in
gllib
, and one for the set of modules that end up in
gltests
. But you should be aware that this does not cover the
general situation.
Which technique to use, depends on the answer to the question: “If my
module occurs among the modules of gltests
, should it have an
effect on the modules in gllib
?”
If the answer is “no”, your module description should invoke the
Autoconf macro gl_MODULE_INDICATOR
. This Autoconf macro takes
one argument: the name of your module. The effect of
gl_MODULE_INDICATOR([my-module])
is to define, in
config.h
, a C macro GNULIB_MY_MODULE
that indicates
whether your macro is considered to be present. This works even when
your macro is used in gltests
: GNULIB_MY_MODULE
will then evaluate to 1 in gltests
but to 0 in gllib
.
If the answer is “yes”, you have two techniques available. The first
one is to invoke a similar Autoconf macro, named
gl_MODULE_INDICATOR_FOR_TESTS
. It works similarly. However,
when your macro is used in gltests
, GNULIB_MY_MODULE
will evaluate to 1 both in gltests
and in gllib
.
The second one is to define a shell variable in the configure
file that tells whether your module is present, through use of
m4_divert_text
. The Autoconf macros of a dependency module will
initialize this shell variable, through
‘m4_divert_text([DEFAULTS], [my_shell_var=no])’. The
Autoconf macros of your module will override this value, through
‘m4_divert_text([INIT_PREPARE], [my_shell_var=yes])’. Then
you can use my_shell_var
in the Autoconf macros of both
modules. You can find more details about this technique in the Gnulib
module getopt-gnu
.
Reminder: These techniques are advanced. They have the potential to cause lots of headaches if you apply them incorrectly.
The function definitions provided by Gnulib (.c
code) are meant
to be compiled by a C compiler. The header files (.h
files),
on the other hand, can be used in either C or C++.
By default, when used in a C++ compilation unit, the .h
files
declare the same symbols and overrides as in C mode, except that functions
defined by Gnulib or by the system are declared as ‘extern "C"’.
It is also possible to indicate to Gnulib to provide many of its symbols
in a dedicated C++ namespace. If you define the macro
GNULIB_NAMESPACE
to an identifier, many functions will be defined
in the namespace specified by the identifier instead of the global
namespace. For example, after you have defined
#define GNULIB_NAMESPACE gnulib
at the beginning of a compilation unit, Gnulib’s <fcntl.h>
header
file will make available the open
function as gnulib::open
.
The symbol open
will still refer to the system’s open
function,
with its platform specific bugs and limitations.
The symbols provided in the Gnulib namespace are those for which the
corresponding header file contains a _GL_CXXALIAS_RPL
or
_GL_CXXALIAS_SYS
macro invocation.
The benefits of this namespace mode are:
open
has to be overridden, Gnulib normally does
#define open rpl_open
. If your package has a class with a member
open
, for example a class foo
with a method foo::open
,
then if you define this member in a compilation unit that includes
<fcntl.h>
and use it in a compilation unit that does not include
<fcntl.h>
, or vice versa, you will get a link error. Worse: You
will not notice this problem on the platform where the system’s open
function works fine. This problem goes away in namespace mode.
gnulib::open
in your code, and you forgot to request the module
‘open’ from Gnulib, you will get a compilation error (regardless of
the platform).
The drawback of this namespace mode is that the system provided symbols in
the global namespace are still present, even when they contain bugs that
Gnulib fixes. For example, if you call open (...)
in your code,
it will invoke the possibly buggy system function, even if you have
requested the module ‘open’ from gnulib-tool.
You can turn on the namespace mode in some compilation units and keep it turned off in others. This can be useful if your package consists of an application layer that does not need to invoke POSIX functions and an operating system interface layer that contains all the OS function calls. In such a situation, you will want to turn on the namespace mode for the application layer—to avoid many preprocessor macro definitions—and turn it off for the OS interface layer—to avoid the drawback of the namespace mode, mentioned above.
Gnulib provides copies of the GNU GPL, GNU LGPL, GNU Affero GPL, and
GNU FDL licenses in Texinfo form. (The master location is
https://www.gnu.org/licenses/). These Texinfo documents do not
have any node names and structures built into them; for your manual,
you should @include
them in an appropriate @node
.
The conventional name for the GPL node is ‘Copying’ and for the FDL ‘GNU Free Documentation License’. The LGPL doesn’t seem to have a conventional node name.
Of course the license texts themselves should not be changed at all.
The recommended way to make use of these license files, consistently with current practice, is as follows:
To make use of the code license in your documentation, you may request
one of the modules gpl-3.0
, gpl-2.0
, lgpl-3.0
,
lgpl-2.1
, agpl-3.0
, through a gnulib-tool
invocation.
Or you may copy the relevant Texinfo file directly into your VCS repository.
Both approaches are equally good. The Texinfo file changes very rarely.
To make use of this documentation license, copy the relevant Texinfo file into your VCS repository. This makes sure that anyone who receives a copy of your VCS repository has also received a copy of the documentation license. In the documentation, also state what are the Invariant Sections, the Front-Cover Texts, and the Back-Cover Texts.
If you wish to help the gnulib development effort with build logs for your favorite platform, you may perform these steps:
Install the proper development tools. To build and test all of
Gnulib, you will need development tools for the programming languages
C, C++, Java, and Perl, along with standard POSIX utilities such as
awk
, make
and sh
. You will also need
development tools that include Autoconf, Automake, Bison, Gettext,
Git, GNU M4, Gperf, Libtool, and Texinfo. Some of these tools are
needed only by some modules. More details can be found in Gnulib’s
DEPENDENCIES file.
See https://www.gnu.org/software/gnulib/ for how to get the current Gnulib sources via Git.
On a machine with GNU development tools installed and with a gnulib git checkout, use
gnulib-tool --create-megatestdir --with-tests --dir=...
Note: The created directory uses ca. 512 MB on disk.
Transfer this directory to a build machine (HP-UX, Cygwin, or whatever). Often it is easier to transfer one file, and this can be achieved by running, inside the directory the following commands:
./configure make dist
And then transferring the dummy-0.tar.gz file.
On the build machine, run ./do-autobuild (or "nohup ./do-autobuild"). It creates a directory logs/ with a log file for each module.
This section shows a radically different way to use Gnulib.
You can extract the ISO C / POSIX substitutes part of gnulib by running the command
gnulib-tool --create-testdir --source-base=lib \ --dir=/tmp/posixlib `posix-modules`
The command ‘posix-modules’ is found in the same directory as
gnulib-tool
.
The resulting directory can be built on a particular platform,
independently of the program being ported. Then you can configure and
build any program, by setting CPPFLAGS
and LDFLAGS
at
configure time accordingly: set CPPFLAGS="-I.../posixlib/lib"
, plus
any essential type definitions and flags that you find in
.../posixlib/config.h
, and set
LDFLAGS=".../posixlib/lib/libgnu.a"
.
This way of using Gnulib is useful when you don’t want to modify the program’s
source code, or when the program uses a mix between C and C++ sources
(requiring separate builds of the posixlib
for the C compiler and
for the C++ compiler).
This chapter describes which header files specified by ISO C or POSIX are substituted by Gnulib, which portability pitfalls are fixed by Gnulib, and which (known) portability problems are not worked around by Gnulib.
The notation “Gnulib module: —” means that Gnulib does not provide a
module providing a substitute for the header file. When the list
“Portability problems not fixed by Gnulib” is empty, such a module is
not needed: No portability problems are known. Otherwise, it indicates
that such a module would be useful but is not available: No one so far
found this header file important enough to contribute a substitute for it.
If you need this particular header file, you may write to
<bug-gnulib at gnu dot org>
.
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/aio.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/arpa_inet.h.html
Gnulib module: arpa_inet
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/assert.h.html
Gnulib module: assert-h
See also the Gnulib modules assert
and verify
.
Portability problems fixed by Gnulib:
static_assert
and _Static_assert
do
not allow the second string-literal argument to be omitted. For
example, GCC versions before 9.1 do not support the single-argument
static_assert
that was standardized by C2X and C++17.
static_assert
or
_Static_assert
at all. For example, GCC versions before 4.6 do
not support _Static_assert
, and G++ versions before 4.3 do not
support static_assert
, which was standardized by C11 and C++11.
Portability problems not fixed by Gnulib:
_Static_assert
and C++ static_assert
are keywords that can be used without including <assert.h>
.
The Gnulib substitutes are macros that require including <assert.h>
.
static_assert
and _Static_assert
can also
be used within a struct
or union
specifier, in place of
an ordinary declaration of a member of the struct or union. The
Gnulib substitute can be used only as an ordinary declaration.
assert
can be applied to any scalar expression.
In C89, the argument to assert
is of type int
.
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/complex.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/cpio.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/ctype.h.html
Gnulib module: ctype
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/dirent.h.html
Gnulib module: dirent
Portability problems fixed by Gnulib:
ino_t
is missing on some platforms:
glibc 2.23 and others.
Portability problems not fixed by Gnulib:
struct dirent
member named
d_type
and directory entry type macros like DT_DIR
and
DT_LNK
, some do not:
Minix 3.1.8, AIX 7.2, HP-UX 11, IRIX 6.5, Solaris 11.4, mingw.
d_type
, not every filesystem supports
d_type
, and those lacking support will set it to DT_UNKNOWN
.
struct dirent
member named d_namlen
containing the string length of d_name
, but others do not:
glibc 2.23 on Linux, Minix 3.1.8, Solaris 11.4, Cygwin.
All of these, except Cygwin, have a member d_reclen
instead,
that has a different semantics.
struct dirent
member named d_off
containing a magic cookie suitable as an argument to seekdir
,
but others do not:
glibc 2.23 on Hurd, macOS 11.1, FreeBSD 11.0, NetBSD 9.0, OpenBSD 6.7, AIX 5.1, HP-UX 11, Cygwin, mingw.
struct dirent
member named
d_reclen
containing the number of bytes in the directory entry
record, but others do not. This member has limited utility, as it is
an implementation detail.
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/dlfcn.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html
Gnulib module: errno
Portability problems fixed by Gnulib:
EOVERFLOW
is not defined
on some platforms:
OpenBSD 4.0, mingw, MSVC 9.
ENOLINK
is not defined
on some platforms:
OpenBSD 6.7, mingw, MSVC 9.
EMULTIHOP
is not defined
on some platforms:
OpenBSD 6.7, mingw, MSVC 14.
ECANCELED
is not defined on some platforms:
OpenBSD 4.0, Cygwin, mingw, MSVC 9.
ENOMSG
, EIDRM
, EPROTO
, EBADMSG
,
ENOTSUP
are not defined on some platforms:
OpenBSD 4.0, mingw, MSVC 9.
ESTALE
is not defined on some platforms:
mingw, MSVC 14.
EDQUOT
is not defined on some platforms:
NonStop Kernel, mingw, MSVC 14.
ENETRESET
, ECONNABORTED
are not defined on some
platforms:
Minix 3.1.8, mingw, MSVC 9.
EWOULDBLOCK
, ETXTBSY
, ELOOP
, ENOTSOCK
,
EDESTADDRREQ
, EMSGSIZE
, EPROTOTYPE
, ENOPROTOOPT
,
EPROTONOSUPPORT
, EOPNOTSUPP
, EAFNOSUPPORT
,
EADDRINUSE
, EADDRNOTAVAIL
, ENETDOWN
, ENETUNREACH
,
ECONNRESET
, ENOBUFS
, EISCONN
, ENOTCONN
,
ETIMEDOUT
, ECONNREFUSED
, EHOSTUNREACH
, EALREADY
,
EINPROGRESS
are not defined on some platforms:
mingw, MSVC 9.
EOWNERDEAD
, ENOTRECOVERABLE
are not defined on
some platforms:
glibc/Linux 2.3.6, glibc/Hurd 2.15, glibc/kFreeBSD 2.15,
Mac OS X 10.5, FreeBSD 6.0, NetBSD 9.0, OpenBSD 6.0, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, Cygwin, mingw without pthreads-win32, MSVC 9.
EILSEQ
is not defined on some platforms:
LynxOS 178 2.2.2.
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/fcntl.h.html
Gnulib module: fcntl-h
Portability problems fixed by Gnulib:
pid_t
is not defined on some platforms:
MSVC 14.
mode_t
is not defined on some platforms:
MSVC 14.
int
on some platforms:
AIX 7.1 with XL C 12.1.
int
on some
platforms:
Solaris 11.3.
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/fenv.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/float.h.html
Gnulib module: float
Portability problems fixed by Gnulib:
int
to long double
in incorrect on some
platforms:
glibc 2.7 on Linux/SPARC64.
LDBL_*
macros are incorrect on some platforms:
On OpenBSD 4.0 and MirBSD 10, they are the same as the values of the
DBL_*
macros, although ‘long double’ is a larger type than
‘double’.
On FreeBSD/x86 6.4, they represent the incorrect 53-bit precision assumptions
in the compiler, not the real 64-bit precision at runtime.
On Linux/PowerPC with GCC 4.4, on AIX 7.1 with GCC 4.2, and on IRIX 6.5,
they don’t reflect the “double double” representation of long double
correctly.
Portability problems not fixed by Gnulib:
FLT_ROUNDS
is a constant expression and does not represent
the current rounding mode on some platforms:
glibc 2.11, HP-UX 11, mingw.
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/fmtmsg.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/fnmatch.h.html
Gnulib module: fnmatch-h
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/ftw.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/glob.h.html
Gnulib module: glob-h
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/grp.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/iconv.h.html
Gnulib module: iconv
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/inttypes.h.html
Gnulib module: inttypes
Portability problems fixed by Gnulib:
imaxabs
and imaxdiv
are missing on some
platforms:
NetBSD 3.0, OpenBSD 6.7, AIX 5.1, HP-UX 11, IRIX 6.5.
strtoimax
and strtoumax
are missing on some
platforms:
OpenBSD 6.7, AIX 5.1 (missing only strtoumax
).
__STDC_FORMAT_MACROS
to make visible the declarations of format
macros such as PRIdMAX
.
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/iso646.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/langinfo.h.html
Gnulib module: langinfo
Portability problems fixed by Gnulib:
CODESET
is not defined on some platforms:
OpenBSD 6.7.
ALTMON_1
to ALTMON_12
are not defined on some
platforms:
glibc 2.26, musl libc, macOS 11.1, NetBSD 8.0, OpenBSD 6.5, AIX 7.2, HP-UX 11.31, IRIX 6.5, Solaris 11.4, Haiku, Cygwin 2.9.
ERA
, ERA_D_FMT
, ERA_D_T_FMT
,
ERA_T_FMT
, ALT_DIGITS
are not defined on some platforms:
OpenBSD 6.7.
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/libgen.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
The Gnulib module dirname
provides similar API, with functions
base_name
and dir_name
that also work with Windows file names.
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html
Gnulib module: limits-h or gethostname
Portability problems fixed by Gnulib module limits-h
:
LLONG_MIN
, LLONG_MAX
, ULLONG_MAX
are not
defined on some platforms:
older glibc systems (e.g. Fedora 1), AIX 5.1, HP-UX 11, IRIX 6.5, OpenVMS.
WORD_BIT
, LONG_BIT
are not defined on some platforms:
glibc 2.11 without -D_GNU_SOURCE
, Cygwin, mingw, MSVC 14.
CHAR_WIDTH
are not defined on some platforms:
glibc 2.24, NetBSD 9.0, many others.
Portability problems fixed by Gnulib module gethostname
:
HOST_NAME_MAX
macro is not defined on some platforms:
macOS 11.1, FreeBSD 13.0, NetBSD 9.0, OpenBSD 6.7, AIX 5.1, HP-UX 11,
IRIX 6.5, Solaris 11.4, Cygwin 1.5.x, mingw, MSVC 14.
Portability problems not fixed by Gnulib:
SSIZE_MAX
has the wrong type,
albeit with the correct value:
32-bit glibc 2.24 (on some architectures), Cygwin 2.5.2.
SSIZE_MAX
is not defined on some platforms:
MSVC 14.
For PATH_MAX
, Gnulib provides a module pathmax
with a header
file "pathmax.h"
. It defines PATH_MAX
to a constant on
platforms with a file name length limit.
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/locale.h.html
Gnulib module: locale
Portability problems fixed by Gnulib:
locale_t
type is not defined on some platforms:
glibc 2.11, macOS 11.1.
struct lconv
type does not contain any members on some platforms:
Android up to 2014.
struct lconv
type does not contain the members
int_p_cs_precedes
, int_p_sign_posn
, int_p_sep_by_space
,
int_n_cs_precedes
, int_n_sign_posn
, int_n_sep_by_space
on some platforms:
glibc, OpenBSD 4.9, HP-UX 11, IRIX 6.5, Solaris 11.4, Cygwin 1.5.x, mingw, MSVC 14.
NULL
macro that cannot be used in arbitrary
expressions:
NetBSD 5.0
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/math.h.html
Gnulib module: math
Portability problems fixed by Gnulib:
int
to long double
in incorrect on some
platforms:
glibc 2.7 on Linux/SPARC64.
NAN
is not defined on some platforms:
OpenBSD 4.0, AIX 5.1, IRIX 6.5.
NAN
is not exposed outside of C99 compilation on some
platforms:
glibc.
NAN
and HUGE_VAL
expand to a function address
rather than a floating point constant on some platforms:
Solaris 10.
HUGE_VALF
and HUGE_VALL
are not defined on some
platforms:
glibc/HPPA, glibc/SPARC, AIX 5.1, IRIX 6.5, Solaris 9, MSVC 9.
FP_ILOGB0
and FP_ILOGBNAN
are not defined on some
platforms:
NetBSD 5.1, AIX 5.1, IRIX 6.5, Solaris 9, MSVC 9.
FP_ILOGB0
and FP_ILOGBNAN
have wrong values on some
platforms:
Haiku 2017.
NAN
, HUGE_VALL
, and INFINITY
are not
defined on some platforms:
OpenVMS.
Portability problems not fixed by Gnulib:
NAN
is not a compile time constant with some compilers:
OpenVMS.
math_errhandling
is not defined on some platforms:
glibc 2.11, OpenBSD 4.9, NetBSD 5.1, UP-UX 11, IRIX 6.5, Cygwin 1.7.9, mingw, MSVC 9.
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/monetary.h.html
Gnulib module: monetary
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/mqueue.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/ndbm.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/net_if.h.html
Gnulib module: net_if
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/netdb.h.html
Gnulib module: netdb
Portability problems fixed by Gnulib:
socklen_t
on some platforms:
IRIX 6.5.
AI_ALL
, AI_V4MAPPED
on some platforms:
NetBSD 9.0.
AI_ADDRCONFIG
on some platforms:
NetBSD 5.0.
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/netinet_in.h.html
Gnulib module: netinet_in
Portability problems fixed by Gnulib:
<sys/types.h>
to be included first):
OpenBSD 4.6.
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/netinet_tcp.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/nl_types.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/poll.h.html
Gnulib module: poll-h
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/pthread.h.html
Gnulib module: pthread-h
Portability problems fixed by Gnulib:
strtok_r
and
gmtime_r
:
mingw 3.0.
Portability problems not fixed by Gnulib:
pthread_atfork
on some
platforms:
IRIX 6.5.
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/pwd.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/regex.h.html
Gnulib module: regex
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
<sys/types.h>
to be included first.
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sched.h.html
Gnulib module: sched
Portability problems fixed by Gnulib:
pid_t
on some platforms:
glibc 2.11, macOS 11.1.
struct sched_param
is not defined on some platforms:
Haiku.
SCHED_FIFO
, SCHED_RR
, SCHED_OTHER
are not defined on
some platforms:
Haiku.
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/search.h.html
Gnulib module: search
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/semaphore.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/setjmp.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html
Gnulib module: signal-h
Portability problems fixed by Gnulib:
volatile sig_atomic_t
is rejected by older compilers on some
platforms:
AIX.
sigset_t
is missing on some platforms:
MSVC 14.
sigset_t
is only declared in <sys/types.h> on some platforms:
mingw.
struct sigaction
and siginfo_t
are missing on some
platforms:
mingw, MSVC 14.
pid_t
is not defined on some platforms:
MSVC 14.
SIGPIPE
is not defined on some platforms:
mingw, MSVC 14.
SA_RESETHAND
and SA_RESTART
are not defined
on some platforms:
NonStop.
sighandler_t
(a GNU extension) is not defined on most non-glibc
platforms:
macOS 11.1, FreeBSD 13.0, NetBSD 9.0, OpenBSD 6.7, AIX 5.1, HP-UX 11,
IRIX 6.5, Solaris 11.4, Cygwin, mingw, MSVC 14.
Portability problems not fixed by Gnulib:
SIGBUS
is set to the same value as SIGSEGV
,
rather than being a distinct signal, on some platforms:
Haiku.
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/spawn.h.html
Gnulib module: spawn
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
Not in POSIX yet, but we expect it will be.
ISO C11 (latest free draft
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf)
sections 6.5.3.4, 6.7.5, 7.15.
C++11 (latest free draft
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf)
section 18.10.
Gnulib module: stdalign
Portability problems fixed by Gnulib:
<stdalign.h>
does not define alignof
/_Alignof
.
alignof
and _Alignof
macros return too large values for
the types double
and long long
in GCC 4.7.0.
Portability problems not fixed by Gnulib:
alignof
/_Alignof
must be a
parenthesized type. Recent versions of GCC support an extension in
which the operand can also be a unary expression, as with
sizeof
. The Gnulib substitute does not support this extension.
alignof
/_Alignof
cannot be a structure type containing a
flexible array member.
_Alignas
and alignas
are not always supported;
on platforms lacking support, the
macro __alignas_is_defined
is not defined.
Supported compilers include GCC, IBM C, Sun C 5.9 and later,
and MSVC 7.0 and later.
alignas
/_Alignas
of auto
variables (i.e.,
variables on the stack). They diagnose and ignore the alignment: Sun
C 5.11.
_Alignas
/alignas
that are greater than 8: mingw.
_Alignas
/alignas
to be a single integer constant, not an expression: MSVC 7.0 through
at least 10.0.
_Alignas
/alignas
. The Sun Studio Developer Bug
Report Review Team assigned the internal review ID 2125432 (dated
2011-11-01) to this issue. The bug appears to be fixed in Sun C 5.15,
also known as Oracle Developer Studio 12.6.
<stdalign.h>
must be #included before _Alignas
and
_Alignof
can be used.
_Alignas
and _Alignof
are reserved words;
they might be macros.
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdarg.h.html
Gnulib module: stdarg
Portability problems fixed by Gnulib:
va_copy
to work.
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdbool.h.html
Gnulib module: stdbool
Portability problems fixed by Gnulib:
true
incorrectly on some platforms:
OpenBSD 4.7 with gcc 2.95.
Portability problems not fixed by Gnulib:
<stdbool.h>
is included, or if
the program is intended to be compiled by a C++ compiler.
_Bool
is a typedef; it might be a macro.
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stddef.h.html
Gnulib module: stddef
Portability problems fixed by Gnulib:
max_align_t
, which was added in C11:
NetBSD 8.0, Solaris 11.0, and others.
max_align_t
does not have the expected alignment on some platforms:
NetBSD 8.0/x86, AIX 7.2 with xlc in 64-bit mode.
wchar_t
.
NULL
macro that cannot be used in arbitrary
expressions:
NetBSD 5.0
NULL
macro whose value does not have the size
of a pointer:
AIX 7.2 with xlc in 64-bit mode.
Portability problems not fixed by Gnulib:
offsetof
macro that cannot be used in
arbitrary expressions:
Solaris 11.4
This problem can be worked around by parenthesizing the
offsetof
expression in the unlikely case you use it with
sizeof
or ‘[]’.
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdint.h.html
Gnulib module: stdint
Portability problems fixed by Gnulib:
SIG_ATOMIC_MIN
and SIG_ATOMIC_MAX
are incorrect
on some platforms:
FreeBSD 6.2/ia64, FreeBSD 13.0/arm64.
WINT_MAX
is incorrect on some platforms:
mingw.
INT8_MAX
, UINT8_MAX
etc. are not usable in
preprocessor expressions on some platforms:
HP-UX 11.23.
INTPTR_MAX
and UINTPTR_MAX
, although correctly
defined in <stdint.h>
, are replaced by empty values when
<limits.h>
or <inttypes.h>
gets included later on some platforms:
Solaris 9 with GCC 4.5 or newer.
WCHAR_MIN
and WCHAR_MAX
are not defined in
<stdint.h>
(only in <wchar.h>
) on some platforms:
Dragonfly.
__STDC_CONSTANT_MACROS
to make visible the definitions of
constant macros such as INTMAX_C
, and one must define
__STDC_LIMIT_MACROS
to make visible the definitions of limit
macros such as INTMAX_MAX
.
SIZE_MAX
has the wrong type,
albeit with the correct value:
32-bit glibc 2.24 (on s390 architecture), Mac OS X 10.7.
INTMAX_WIDTH
are not defined on some platforms:
glibc 2.24, NetBSD 9.0, many others.
Portability problems not fixed by Gnulib:
{uint,int}_fast{8,16,32,64}_t
may not correspond to the fastest
types available on the system.
Other <stdint.h>
substitutes may define these types differently,
so public header files should avoid these types.
long int
.
For example, as of 2007, Sun C mishandles #if LLONG_MIN < 0
on
a platform with 32-bit long int
and 64-bit long long int
.
Some older preprocessors mishandle constants ending in LL
.
To work around these problems, compute the value of expressions like
LONG_MAX < LLONG_MAX
at configure
-time rather than at
#if
-time.
The stdint
module uses #include_next
. If you wish to install
the generated stdint.h file under another name, typically in order to
be able to use some of the types defined by stdint.h in your public
header file, you could use the following Makefile.am-snippet:
BUILT_SOURCES += idn-int.h DISTCLEANFILES += idn-int.h nodist_include_HEADERS += idn-int.h idn-int.h: if test -n "$(STDINT_H)"; then \ sed -e s/include_next/include/ gl/stdint.h > idn-int.h; \ else \ echo '#include <stdint.h>' > idn-int.h; \ fi
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdio.h.html
Gnulib module: stdio
Portability problems fixed by Gnulib:
off_t
is missing on some platforms:
glibc 2.8, eglibc 2.11.2 and others.
ssize_t
is missing on some platforms:
glibc 2.8, Mac OS X 10.5, Solaris 10, MSVC 14, and others.
va_list
is missing on some platforms:
glibc 2.8, OpenBSD 4.0, Solaris 11.4, and others.
NULL
macro that cannot be used in arbitrary
expressions:
NetBSD 5.0
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdlib.h.html
Gnulib module: stdlib, system-posix
Portability problems fixed by the Gnulib module stdlib
:
EXIT_SUCCESS
and EXIT_FAILURE
are not defined on
some platforms.
NULL
macro that cannot be used in arbitrary
expressions:
NetBSD 5.0
Portability problems fixed by the Gnulib module system-posix
:
WIFSIGNALED
, WIFEXITED
, WIFSTOPPED
,
WTERMSIG
, WEXITSTATUS
, WNOHANG
, WUNTRACED
,
WSTOPSIG
are not defined in this header file (only in
<sys/wait.h>
) on some platforms:
MirBSD 10.
Portability problems not fixed by Gnulib:
WEXITSTATUS
require an lvalue
argument on some platforms.
macOS 11.1.
POSIX specification:
Not in POSIX yet, but we expect it will be.
ISO C11 (latest free draft
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf)
sections 7.23.
Gnulib module: stdnoreturn
Portability problems fixed by Gnulib:
<stdlib.h>
and
<process.h>
, on some platforms:
MSVC/clang.
Portability problems not fixed by Gnulib:
<stdnoreturn.h>
should be #included before ‘_Noreturn’ is used.
_Noreturn
is a reserved word;
it might be a macro.
lint
is defined, standard headers define
_Noreturn
(and therefore noreturn
) to be a macro that
expands to the empty token sequence on some platforms:
Cygwin 2.5.1, FreeBSD 10.3.
noreturn
expands to the empty token
sequence, to avoid problems with standard headers that use noreturn
in combination with __attribute__
or __declspec
. Although
the resulting code operates correctly, the compiler is not informed whether
noreturn
functions do not return, so it may generate incorrect
warnings at compile-time, or code that is slightly less optimized. This
problem does not occur with _Noreturn
.
-Werror=old-style-declaration
requires _Noreturn
or noreturn
before the returned type
in a declaration, and therefore rejects valid but unusually-worded
declarations such as void _Noreturn foo (void);
.
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/string.h.html
Gnulib module: string
Portability problems fixed by Gnulib:
NULL
macro that cannot be used in arbitrary
expressions:
NetBSD 5.0
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/strings.h.html
Gnulib module: strings
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stropts.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_ipc.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_mman.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_msg.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_resource.h.html
Gnulib module: sys_resource
Portability problems fixed by Gnulib:
RUSAGE_SELF
and
RUSAGE_CHILDREN
constants:
OpenVMS.
Portability problems not fixed by Gnulib:
RLIM_SAVED_CUR
or RLIM_SAVED_MAX
.
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_select.h.html
Gnulib module: sys_select
Portability problems fixed by Gnulib:
<sys/types.h>
to be included first.
<string.h>
before FD_ZERO
can be used—on some platforms:
AIX 7.1, Solaris 11.4.
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_sem.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_shm.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_socket.h.html
Gnulib module: sys_socket
Portability problems fixed by Gnulib:
<sys/types.h>
to be included first.
socklen_t
on some platforms:
IRIX 6.5.
struct iovec
on some platforms:
OpenBSD 4.4.
SHUT_RD
, SHUT_WR
,
SHUT_RDWR
macros on some platforms, despite having the shutdown
functions:
emx+gcc.
struct sockaddr_storage
type does not have a member ss_family
on some platforms:
AIX 7.1.
CMSG_SPACE
and CMSG_LEN
macros are not provided on some
platforms:
OpenVMS.
SO_REUSEPORT
macro on some
platforms:
Minix 3.1.8, Solaris 10, Cygwin, mingw, MSVC 14.
Portability problems not fixed by Gnulib:
msg_control
and
msg_controllen
members of struct msghdr
on some
platforms. This can be detected by the absence of the
CMSG_FIRSTHDR
macro:
gnulib replacement header, old BSD
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html
Gnulib module: sys_stat
Portability problems fixed by Gnulib module sys_stat
:
mode_t
is not defined on some platforms:
MSVC 14.
S_IFMT
or S_IFIFO
, are missing on some
platforms.
S_ISBLK
, S_ISCHR
, S_ISDIR
, S_ISFIFO
,
S_ISLNK
, S_ISREG
, S_ISSOCK
are broken on some platforms.
S_ISDOOR
, that are not defined
on other platforms.
lstat
and mkdir
are not declared on some platforms:
mingw, MSVC 14.
UTIME_NOW
and UTIME_OMIT
are missing on some
platforms.
struct stat
does not include st_atim
,
st_mtim
, or st_ctim
members. Use the gnulib module
‘stat-time’ for accessors to portably get at subsecond resolution.
Portability problems fixed by Gnulib module sys_stat
, together with module windows-stat-inodes
:
st_ino
is always 0.
Portability problems not fixed by Gnulib:
time_t
components of struct stat
.
S_IFBLK
is missing on some platforms:
MSVC 14.
st_ino
is an array of three ino_t
values,
not a single value.
st_ino
and use the Gnulib same-inode
module to
compare nonzero values. For example, SAME_INODE (a, b)
is true if the struct stat
values a
and
b
are known to represent the same file, (a.st_ino &&
!SAME_INODE (a, b))
is true if they are known to represent different
files, and !a.st_ino
is true if it is not known whether they
represent different files.
st_dev
and st_ino
values, even when st_ino
is nonzero:
st_dev
exceeds 255, or if a local
st_ino
exceeds 16777215.
One partial workaround is to compare other file metadata such as
st_mode
and st_mtime
to detect this bug, but this
approach does not work on files whose metadata are being changed by
other programs.
st_size
contains bogus information for
symlinks; use the Gnulib module areadlink-with-size
for a
better way to get symlink contents.
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_statvfs.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_time.h.html
Gnulib module: sys_time
Portability problems fixed by Gnulib:
tv_sec
type that is
narrower than time_t
on some native Windows platforms:
mingw64 in 64-bit mode,
mingw64 in 32-bit mode when __MINGW_USE_VC2005_COMPAT
is defined,
MSVC 14 in 64-bit mode,
MSVC 14 in 32-bit mode when _USE_32BIT_TIME_T
is not defined.
Portability problems not fixed by Gnulib:
tv_sec
type that is
wider than time_t
:
OpenBSD 5.1 in 64-bit mode.
POSIX specification:
https://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/timeb.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_times.h.html
Gnulib module: sys_times
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html
Gnulib module: sys_types
Portability problems fixed by Gnulib:
pid_t
is not defined on some platforms:
MSVC 14.
size_t
is not defined in this file on some platforms:
MSVC 14.
ssize_t
is not defined on some platforms:
MSVC 14.
mode_t
is not defined on some platforms:
MSVC 14.
major
, minor
, and
makedev
through this header; however, when
sys/sysmacros.h exists, that file should also be included to
avoid deprecation warnings from the versions in this header:
glibc 2.25.
Portability problems not fixed by Gnulib:
blksize_t
and suseconds_t
are signed integer types that are wider than long
:
glibc x32
This module, together with the module largefile
, also defines the type
off_t
to a 64-bit integer type on some platforms:
mingw, MSVC 14.
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_uio.h.html
Gnulib module: sys_uio
Portability problems fixed by Gnulib:
<sys/types.h>
to be
included first) on some platforms:
OpenBSD 4.4.
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_un.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_utsname.h.html
Gnulib module: sys_utsname
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_wait.h.html
Gnulib module: sys_wait
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
WEXITSTATUS
require an lvalue
argument on some platforms.
macOS 11.1.
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/syslog.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/tar.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/termios.h.html
Gnulib module: termios
Portability problems fixed by Gnulib:
pid_t
on all platforms:
glibc on some architectures, FreeBSD 6.4, OpenBSD 4.9, Cygwin 1.7.11.
Portability problems not fixed by Gnulib:
struct termios
, cc_t
, speed_t
, tcflag_t
are not defined on some platforms:
mingw, MSVC 14.
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/tgmath.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
Defines the multithreading facility of ISO C11.
Gnulib module: threads-h
Portability problems fixed by Gnulib:
thrd_start_t
incorrectly on some platforms:
AIX 7.2.
TSS_DTOR_ITERATIONS
on some platforms:
AIX 7.2.
Portability problems not fixed by Gnulib:
thread_local
macro on some platforms:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/time.h.html
Gnulib module: time
Portability problems fixed by Gnulib:
time_t
defaults to 32-bit but can be
changed to 64-bit, functions like stat
can fail with
errno == EOVERFLOW
when a 32-bit timestamp is out of range,
such as with a file timestamp in the far future or past:
glibc 2.34.
TIME_UTC
is not defined on many platforms:
glibc 2.15, macOS 10.13, FreeBSD 11.0, NetBSD 7.1, OpenBSD 6.0, Minix 3.1.8, AIX 7.1, HP-UX 11.31, IRIX 6.5, Solaris 11.3, Cygwin 2.9, mingw, MSVC 14, Android 9.0.
NULL
macro that cannot be used in arbitrary
expressions:
NetBSD 5.0.
Portability problems not fixed by Gnulib:
time_t
is always 32-bit, functions like
stat
can fail with errno == EOVERFLOW
when a timestamp
is out of range, such as with a file timestamp in the far future or
past; on other such platforms,
the functions silently return the low-order 32 bits of the correct
timestamp. These platforms will be obsolete when 32-bit time_t
rolls around, which will occur in 2038 for the typical case when
time_t
is signed.
tv_nsec
member of struct timespec
is not of type long
, but is of type long long
instead:
glibc x32
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/trace.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
Defines the types char16_t
, char32_t
and declares the
functions mbrtoc16
, c16rtomb
, mbrtoc32
,
c32rtomb
.
Gnulib module: uchar
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/009695399/basedefs/ucontext.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/ulimit.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html
Gnulib module: unistd
Portability problems fixed by Gnulib:
_exit
function is not declared in this file on some platforms:
mingw.
NULL
macro that cannot be used in arbitrary
expressions:
NetBSD 5.0
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/utime.h.html
Gnulib module: utime-h
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/utmpx.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/wchar.h.html
Gnulib module: wchar
Portability problems fixed by Gnulib:
wint_t
is incorrect on some platforms:
mingw, MSVC 14.
NULL
macro that cannot be used in arbitrary
expressions:
NetBSD 5.0
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/wctype.h.html
Gnulib module: wctype-h
Portability problems fixed by Gnulib:
wint_t
is incorrect on some platforms:
mingw, MSVC 14.
isw*
are missing on some platforms:
FreeBSD 4.11.
iswblank
is declared but not defined on some platforms:
IRIX 6.5.30.
Portability problems not fixed by Gnulib:
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/wordexp.h.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
This chapter describes which functions and function-like macros specified by ISO C (including ISO TS 18661-1) or POSIX are substituted by Gnulib, which portability pitfalls are fixed by Gnulib, and which (known) portability problems are not worked around by Gnulib.
The notation “Gnulib module: —” means that Gnulib does not provide a
module providing a substitute for the function. When the list
“Portability problems not fixed by Gnulib” is empty, such a module is
not needed: No portability problems are known. Otherwise, it indicates
that such a module would be useful but is not available: No one so far
found this function important enough to contribute a substitute for it.
If you need this particular function, you may write to
<bug-gnulib at gnu dot org>
.
FD_CLR
FD_ISSET
FD_SET
FD_ZERO
_Exit
_exit
_longjmp
_setjmp
_tolower
_toupper
a64l
abort
abs
accept
access
acos
acosf
acosh
acoshf
acoshl
acosl
aio_cancel
aio_error
aio_fsync
aio_read
aio_return
aio_suspend
aio_write
alarm
aligned_alloc
alphasort
asctime
asctime_r
asin
asinf
asinh
asinhf
asinhl
asinl
assert
atan
atan2
atan2f
atan2l
atanf
atanh
atanhf
atanhl
atanl
atexit
atof
atoi
atol
atoll
basename
bind
bsearch
btowc
c16rtomb
c32rtomb
cabs
cabsf
cabsl
cacos
cacosf
cacosh
cacoshf
cacoshl
cacosl
calloc
call_once
canonicalize
canonicalizef
canonicalizel
carg
cargf
cargl
casin
casinf
casinh
casinhf
casinhl
casinl
catan
catanf
catanh
catanhf
catanhl
catanl
catclose
catgets
catopen
cbrt
cbrtf
cbrtl
ccos
ccosf
ccosh
ccoshf
ccoshl
ccosl
ceil
ceilf
ceill
cexp
cexpf
cexpl
cfgetispeed
cfgetospeed
cfsetispeed
cfsetospeed
chdir
chmod
chown
cimag
cimagf
cimagl
clearerr
clock
clock_getcpuclockid
clock_getres
clock_gettime
clock_nanosleep
clock_settime
clog
clogf
clogl
close
closedir
closelog
cnd_broadcast
cnd_destroy
cnd_init
cnd_signal
cnd_timedwait
cnd_wait
confstr
conj
conjf
conjl
connect
copysign
copysignf
copysignl
cos
cosf
cosh
coshf
coshl
cosl
cpow
cpowf
cpowl
cproj
cprojf
cprojl
creal
crealf
creall
creat
crypt
csin
csinf
csinh
csinhf
csinhl
csinl
csqrt
csqrtf
csqrtl
ctan
ctanf
ctanh
ctanhf
ctanhl
ctanl
ctermid
ctime
ctime_r
daddl
daylight
dbm_clearerr
dbm_close
dbm_delete
dbm_error
dbm_fetch
dbm_firstkey
dbm_nextkey
dbm_open
dbm_store
ddivl
difftime
dirfd
dirname
div
dlclose
dlerror
dlopen
dlsym
dmull
dprintf
drand48
dsubl
dup
dup2
duplocale
encrypt
endgrent
endhostent
endnetent
endprotoent
endpwent
endservent
endutxent
environ
erand48
erf
erfc
erfcf
erfcl
erff
erfl
errno
execl
execle
execlp
execv
execve
execvp
exit
exp
exp2
exp2f
exp2l
expf
expl
expm1
expm1f
expm1l
fabs
fabsf
fabsl
faccessat
fadd
faddl
fattach
fchdir
fchmod
fchmodat
fchown
fchownat
fclose
fcntl
fdatasync
fdetach
fdim
fdimf
fdiml
fdiv
fdivl
fdopen
fdopendir
feclearexcept
fegetenv
fegetexceptflag
fegetmode
fegetround
feholdexcept
feof
feraiseexcept
ferror
fesetenv
fesetexcept
fesetexceptflag
fesetmode
fesetround
fetestexcept
fetestexceptflag
feupdateenv
fexecve
fflush
ffs
fgetc
fgetpos
fgets
fgetwc
fgetws
fileno
flockfile
floor
floorf
floorl
fma
fmaf
fmal
fmax
fmaxf
fmaxl
fmaxmag
fmaxmagf
fmaxmagl
fmemopen
fmin
fminf
fminl
fminmag
fminmagf
fminmagl
fmod
fmodf
fmodl
fmtmsg
fmul
fmull
fnmatch
fopen
fork
fpathconf
fpclassify
fprintf
fputc
fputs
fputwc
fputws
fread
free
freeaddrinfo
freelocale
freopen
frexp
frexpf
frexpl
fromfp
fromfpf
fromfpl
fromfpx
fromfpxf
fromfpxl
fscanf
fseek
fseeko
fsetpos
fstat
fstatat
fstatvfs
fsub
fsubl
fsync
ftell
ftello
ftok
ftruncate
ftrylockfile
ftw
funlockfile
futimens
fwide
fwprintf
fwrite
fwscanf
gai_strerror
getaddrinfo
getc
getc_unlocked
getchar
getchar_unlocked
getcwd
getdate
getdate_err
getdelim
getegid
getenv
geteuid
getgid
getgrent
getgrgid
getgrgid_r
getgrnam
getgrnam_r
getgroups
gethostent
gethostid
gethostname
getitimer
getline
getlogin
getlogin_r
getmsg
getnameinfo
getnetbyaddr
getnetbyname
getnetent
getopt
getpayload
getpayloadf
getpayloadl
getpeername
getpgid
getpgrp
getpid
getpmsg
getppid
getpriority
getprotobyname
getprotobynumber
getprotoent
getpwent
getpwnam
getpwnam_r
getpwuid
getpwuid_r
getrlimit
getrusage
gets
getservbyname
getservbyport
getservent
getsid
getsockname
getsockopt
getsubopt
gettimeofday
getuid
getutxent
getutxid
getutxline
getwc
getwchar
glob
globfree
gmtime
gmtime_r
grantpt
hcreate
hdestroy
hsearch
htonl
htons
hypot
hypotf
hypotl
iconv
iconv_close
iconv_open
if_freenameindex
if_indextoname
if_nameindex
if_nametoindex
ilogb
ilogbf
ilogbl
imaxabs
imaxdiv
inet_addr
inet_ntoa
inet_ntop
inet_pton
initstate
insque
ioctl
isalnum
isalnum_l
isalpha
isalpha_l
isascii
isastream
isatty
isblank
isblank_l
iscntrl
iscntrl_l
isdigit
isdigit_l
isfinite
isgraph
isgraph_l
isgreater
isgreaterequal
isinf
isless
islessequal
islessgreater
islower
islower_l
isnan
isnormal
isprint
isprint_l
ispunct
ispunct_l
isspace
isspace_l
isunordered
isupper
isupper_l
iswalnum
iswalnum_l
iswalpha
iswalpha_l
iswblank
iswblank_l
iswcntrl
iswcntrl_l
iswctype
iswctype_l
iswdigit
iswdigit_l
iswgraph
iswgraph_l
iswlower
iswlower_l
iswprint
iswprint_l
iswpunct
iswpunct_l
iswspace
iswspace_l
iswupper
iswupper_l
iswxdigit
iswxdigit_l
isxdigit
isxdigit_l
j0
j1
jn
jrand48
kill
killpg
l64a
labs
lchown
lcong48
ldexp
ldexpf
ldexpl
ldiv
lfind
lgamma
lgammaf
lgammal
link
linkat
lio_listio
listen
llabs
lldiv
llogb
llogbf
llogbl
llrint
llrintf
llrintl
llround
llroundf
llroundl
localeconv
localtime
localtime_r
lockf
log
log10
log10f
log10l
log1p
log1pf
log1pl
log2
log2f
log2l
logb
logbf
logbl
logf
logl
longjmp
lrand48
lrint
lrintf
lrintl
lround
lroundf
lroundl
lsearch
lseek
lstat
malloc
mblen
mbrlen
mbrtoc16
mbrtoc32
mbrtowc
mbsinit
mbsnrtowcs
mbsrtowcs
mbstowcs
mbtowc
memccpy
memchr
memcmp
memcpy
memmove
memset
mkdir
mkdirat
mkdtemp
mkfifo
mkfifoat
mknod
mknodat
mkstemp
mktime
mlock
mlockall
mmap
modf
modff
modfl
mprotect
mq_close
mq_getattr
mq_notify
mq_open
mq_receive
mq_send
mq_setattr
mq_timedreceive
mq_timedsend
mq_unlink
mrand48
msgctl
msgget
msgrcv
msgsnd
msync
mtx_destroy
mtx_init
mtx_lock
mtx_timedlock
mtx_trylock
mtx_unlock
munlock
munlockall
munmap
nan
nanf
nanl
nanosleep
nearbyint
nearbyintf
nearbyintl
newlocale
nextafter
nextafterf
nextafterl
nextdown
nextdownf
nextdownl
nexttoward
nexttowardf
nexttowardl
nextup
nextupf
nextupl
nftw
nice
nl_langinfo
nl_langinfo_l
nrand48
ntohl
ntohs
open
openat
opendir
openlog
open_memstream
open_wmemstream
optarg
opterr
optind
optopt
pathconf
pause
pclose
perror
pipe
poll
popen
posix_fadvise
posix_fallocate
posix_madvise
posix_mem_offset
posix_memalign
posix_openpt
posix_spawn
posix_spawn_file_actions_addclose
posix_spawn_file_actions_adddup2
posix_spawn_file_actions_addopen
posix_spawn_file_actions_destroy
posix_spawn_file_actions_init
posix_spawnattr_destroy
posix_spawnattr_getflags
posix_spawnattr_getpgroup
posix_spawnattr_getschedparam
posix_spawnattr_getschedpolicy
posix_spawnattr_getsigdefault
posix_spawnattr_getsigmask
posix_spawnattr_init
posix_spawnattr_setflags
posix_spawnattr_setpgroup
posix_spawnattr_setschedparam
posix_spawnattr_setschedpolicy
posix_spawnattr_setsigdefault
posix_spawnattr_setsigmask
posix_spawnp
posix_trace_attr_destroy
posix_trace_attr_getclockres
posix_trace_attr_getcreatetime
posix_trace_attr_getgenversion
posix_trace_attr_getinherited
posix_trace_attr_getlogfullpolicy
posix_trace_attr_getlogsize
posix_trace_attr_getmaxdatasize
posix_trace_attr_getmaxsystemeventsize
posix_trace_attr_getmaxusereventsize
posix_trace_attr_getname
posix_trace_attr_getstreamfullpolicy
posix_trace_attr_getstreamsize
posix_trace_attr_init
posix_trace_attr_setinherited
posix_trace_attr_setlogfullpolicy
posix_trace_attr_setlogsize
posix_trace_attr_setmaxdatasize
posix_trace_attr_setname
posix_trace_attr_setstreamfullpolicy
posix_trace_attr_setstreamsize
posix_trace_clear
posix_trace_close
posix_trace_create
posix_trace_create_withlog
posix_trace_event
posix_trace_eventid_equal
posix_trace_eventid_get_name
posix_trace_eventid_open
posix_trace_eventset_add
posix_trace_eventset_del
posix_trace_eventset_empty
posix_trace_eventset_fill
posix_trace_eventset_ismember
posix_trace_eventtypelist_getnext_id
posix_trace_eventtypelist_rewind
posix_trace_flush
posix_trace_get_attr
posix_trace_get_filter
posix_trace_get_status
posix_trace_getnext_event
posix_trace_open
posix_trace_rewind
posix_trace_set_filter
posix_trace_shutdown
posix_trace_start
posix_trace_stop
posix_trace_timedgetnext_event
posix_trace_trid_eventid_open
posix_trace_trygetnext_event
posix_typed_mem_get_info
posix_typed_mem_open
pow
powf
powl
pread
printf
pselect
psiginfo
psignal
pthread_atfork
pthread_attr_destroy
pthread_attr_getdetachstate
pthread_attr_getguardsize
pthread_attr_getinheritsched
pthread_attr_getschedparam
pthread_attr_getschedpolicy
pthread_attr_getscope
pthread_attr_getstack
pthread_attr_getstacksize
pthread_attr_init
pthread_attr_setdetachstate
pthread_attr_setguardsize
pthread_attr_setinheritsched
pthread_attr_setschedparam
pthread_attr_setschedpolicy
pthread_attr_setscope
pthread_attr_setstack
pthread_attr_setstacksize
pthread_barrier_destroy
pthread_barrier_init
pthread_barrier_wait
pthread_barrierattr_destroy
pthread_barrierattr_getpshared
pthread_barrierattr_init
pthread_barrierattr_setpshared
pthread_cancel
pthread_cleanup_pop
pthread_cleanup_push
pthread_cond_broadcast
pthread_cond_destroy
pthread_cond_init
pthread_cond_signal
pthread_cond_timedwait
pthread_cond_wait
pthread_condattr_destroy
pthread_condattr_getclock
pthread_condattr_getpshared
pthread_condattr_init
pthread_condattr_setclock
pthread_condattr_setpshared
pthread_create
pthread_detach
pthread_equal
pthread_exit
pthread_getconcurrency
pthread_getcpuclockid
pthread_getschedparam
pthread_getspecific
pthread_join
pthread_key_create
pthread_key_delete
pthread_kill
pthread_mutex_consistent
pthread_mutex_destroy
pthread_mutex_getprioceiling
pthread_mutex_init
pthread_mutex_lock
pthread_mutex_setprioceiling
pthread_mutex_timedlock
pthread_mutex_trylock
pthread_mutex_unlock
pthread_mutexattr_destroy
pthread_mutexattr_getprioceiling
pthread_mutexattr_getprotocol
pthread_mutexattr_getpshared
pthread_mutexattr_getrobust
pthread_mutexattr_gettype
pthread_mutexattr_init
pthread_mutexattr_setprioceiling
pthread_mutexattr_setprotocol
pthread_mutexattr_setpshared
pthread_mutexattr_setrobust
pthread_mutexattr_settype
pthread_once
pthread_rwlock_destroy
pthread_rwlock_init
pthread_rwlock_rdlock
pthread_rwlock_timedrdlock
pthread_rwlock_timedwrlock
pthread_rwlock_tryrdlock
pthread_rwlock_trywrlock
pthread_rwlock_unlock
pthread_rwlock_wrlock
pthread_rwlockattr_destroy
pthread_rwlockattr_getpshared
pthread_rwlockattr_init
pthread_rwlockattr_setpshared
pthread_self
pthread_setcancelstate
pthread_setcanceltype
pthread_setconcurrency
pthread_setschedparam
pthread_setschedprio
pthread_setspecific
pthread_sigmask
pthread_spin_destroy
pthread_spin_init
pthread_spin_lock
pthread_spin_trylock
pthread_spin_unlock
pthread_testcancel
ptsname
putc
putc_unlocked
putchar
putchar_unlocked
putenv
putmsg
putpmsg
puts
pututxline
putwc
putwchar
pwrite
qsort
quick_exit
raise
rand
rand_r
random
read
readdir
readdir_r
readlink
readlinkat
readv
realloc
realpath
recv
recvfrom
recvmsg
regcomp
regerror
regexec
regfree
remainder
remainderf
remainderl
remove
remque
remquo
remquof
remquol
rename
renameat
rewind
rewinddir
rint
rintf
rintl
rmdir
round
roundeven
roundevenf
roundevenl
roundf
roundl
scalbln
scalblnf
scalblnl
scalbn
scalbnf
scalbnl
scandir
scanf
sched_get_priority_max
sched_get_priority_min
sched_getparam
sched_getscheduler
sched_rr_get_interval
sched_setparam
sched_setscheduler
sched_yield
seed48
seekdir
select
sem_close
sem_destroy
sem_getvalue
sem_init
sem_open
sem_post
sem_timedwait
sem_trywait
sem_unlink
sem_wait
semctl
semget
semop
send
sendmsg
sendto
setbuf
setegid
setenv
seteuid
setgid
setgrent
sethostent
setitimer
setjmp
setkey
setlocale
setlogmask
setnetent
setpayload
setpayloadf
setpayloadl
setpayloadsig
setpayloadsigf
setpayloadsigl
setpgid
setpgrp
setpriority
setprotoent
setpwent
setregid
setreuid
setrlimit
setservent
setsid
setsockopt
setstate
setuid
setutxent
setvbuf
shm_open
shm_unlink
shmat
shmctl
shmdt
shmget
shutdown
sigaction
sigaddset
sigaltstack
sigdelset
sigemptyset
sigfillset
sighold
sigignore
siginterrupt
sigismember
siglongjmp
signal
signbit
signgam
sigpause
sigpending
sigprocmask
sigqueue
sigrelse
sigset
sigsetjmp
sigsuspend
sigtimedwait
sigwait
sigwaitinfo
sin
sinf
sinh
sinhf
sinhl
sinl
sleep
snprintf
sockatmark
socket
socketpair
sprintf
sqrt
sqrtf
sqrtl
srand
srand48
srandom
sscanf
stat
statvfs
stderr
stdin
stdout
stpcpy
stpncpy
strcasecmp
strcasecmp_l
strcat
strchr
strcmp
strcoll
strcoll_l
strcpy
strcspn
strdup
strerror
strerror_l
strerror_r
strfmon
strfmon_l
strfromd
strfromf
strfroml
strftime
strftime_l
strlen
strncasecmp
strncasecmp_l
strncat
strncmp
strncpy
strndup
strnlen
strpbrk
strptime
strrchr
strsignal
strspn
strstr
strtod
strtof
strtoimax
strtok
strtok_r
strtol
strtold
strtoll
strtoul
strtoull
strtoumax
strxfrm
strxfrm_l
swab
swprintf
swscanf
symlink
symlinkat
sync
sysconf
syslog
system
tan
tanf
tanh
tanhf
tanhl
tanl
tcdrain
tcflow
tcflush
tcgetattr
tcgetpgrp
tcgetsid
tcsendbreak
tcsetattr
tcsetpgrp
tdelete
telldir
tempnam
tfind
tgamma
tgammaf
tgammal
thrd_create
thrd_current
thrd_detach
thrd_equal
thrd_exit
thrd_join
thrd_sleep
thrd_yield
time
timer_create
timer_delete
timer_getoverrun
timer_gettime
timer_settime
times
timezone
tmpfile
tmpnam
toascii
tolower
tolower_l
totalorder
totalorderf
totalorderl
totalordermag
totalordermagf
totalordermagl
toupper
toupper_l
towctrans
towctrans_l
towlower
towlower_l
towupper
towupper_l
trunc
truncate
truncf
truncl
tsearch
tss_create
tss_delete
tss_get
tss_set
ttyname
ttyname_r
twalk
tzname
tzset
ufromfp
ufromfpf
ufromfpl
ufromfpx
ufromfpxf
ufromfpxl
ulimit
umask
uname
ungetc
ungetwc
unlink
unlinkat
unlockpt
unsetenv
uselocale
utime
utimensat
utimes
va_arg
va_copy
va_end
va_start
vdprintf
vfprintf
vfscanf
vfwprintf
vfwscanf
vprintf
vscanf
vsnprintf
vsprintf
vsscanf
vswprintf
vswscanf
vwprintf
vwscanf
wait
waitid
waitpid
wcpcpy
wcpncpy
wcrtomb
wcscasecmp
wcscasecmp_l
wcscat
wcschr
wcscmp
wcscoll
wcscoll_l
wcscpy
wcscspn
wcsdup
wcsftime
wcslen
wcsncasecmp
wcsncasecmp_l
wcsncat
wcsncmp
wcsncpy
wcsnlen
wcsnrtombs
wcspbrk
wcsrchr
wcsrtombs
wcsspn
wcsstr
wcstod
wcstof
wcstoimax
wcstok
wcstol
wcstold
wcstoll
wcstombs
wcstoul
wcstoull
wcstoumax
wcswidth
wcsxfrm
wcsxfrm_l
wctob
wctomb
wctrans
wctrans_l
wctype
wctype_l
wcwidth
wmemchr
wmemcmp
wmemcpy
wmemmove
wmemset
wordexp
wordfree
wprintf
write
writev
wscanf
y0
y1
yn
FD_CLR
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/FD_CLR.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
FD_ISSET
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/FD_ISSET.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
FD_SET
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/FD_SET.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
FD_ZERO
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/FD_ZERO.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
_Exit
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/_Exit.html
Gnulib module: _Exit
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
_exit
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/_exit.html
Gnulib module: unistd
Portability problems fixed by Gnulib:
<stdlib.h>
)
on some platforms:
mingw, MSVC 14.
Portability problems not fixed by Gnulib:
_longjmp
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/_longjmp.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
Note: A future revision of POSIX later than the 2008/2009 one may drop the
functions _setjmp
and _longjmp
. Still, in 2008, on all
systems which have _setjmp
, it is the fastest way to save the
registers but not the signal mask (up to 30 times faster than setjmp
on some systems).
_setjmp
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/_setjmp.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
Note: A future revision of POSIX later than the 2008/2009 one may drop the
functions _setjmp
and _longjmp
. Still, in 2008, on all
systems which have _setjmp
, it is the fastest way to save the
registers but not the signal mask (up to 30 times faster than setjmp
on some systems).
_tolower
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/_tolower.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
_toupper
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/_toupper.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
a64l
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/a64l.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
abort
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/abort.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
abs
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/abs.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
accept
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/accept.html
Gnulib module: accept
Portability problems fixed by Gnulib:
accept
function cannot be used in calls to read
,
write
, and close
; you have to use recv
, send
,
closesocket
in these cases instead.
errno
, and WSAGetLastError
must be used
instead.
_HPUX_ALT_XOPEN_SOCKET_API
is not defined, this function behaves incorrectly because it is declared
to take a pointer to a 64-bit wide socklen_t
entity but in fact
considers it as a pointer to a 32-bit wide unsigned int
entity.
Portability problems not fixed by Gnulib:
socklen_t
type; in this case this function’s
third argument type is ‘int *’.
access
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/access.html
Gnulib module: access
Portability problems fixed by Gnulib:
X_OK
mode on some platforms:
MSVC 14.
Portability problems not fixed by Gnulib:
Other problems of this function:
stat
versus lstat
). If you need this option, use
the Gnulib module faccessat
with the AT_EACCESS
flag.
execlp
or execvp
. Nevertheless,
this function may return true for such files.
execlp
and execvp
search for files with the
suffixes .com
, .exe
, .bat
, .cmd
, when the
file with the given file name does not exist. Whereas cmd.exe
searches according to the PATHEXT
environment variable. This
function does not perform any search; it merely looks at the file with
the given file name.
acos
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/acos.html
Gnulib module: acos
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
acosf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/acosf.html
Gnulib module: acosf
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
acosh
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/acosh.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
acoshf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/acoshf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
acoshl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/acoshl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
acosl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/acosl.html
Gnulib module: acosl
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
aio_cancel
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_cancel.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
off_t
is a 32-bit type, this function may not
work correctly on files larger than 2 GB. The fix is to use the
AC_SYS_LARGEFILE
macro.
aio_error
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_error.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
off_t
is a 32-bit type, this function may not
work correctly on files larger than 2 GB. The fix is to use the
AC_SYS_LARGEFILE
macro.
aio_fsync
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_fsync.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
off_t
is a 32-bit type, this function may not
work correctly on files larger than 2 GB. The fix is to use the
AC_SYS_LARGEFILE
macro.
aio_read
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_read.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
off_t
is a 32-bit type, this function may not
work correctly on files larger than 2 GB. The fix is to use the
AC_SYS_LARGEFILE
macro.
aio_return
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_return.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
off_t
is a 32-bit type, this function may not
work correctly on files larger than 2 GB. The fix is to use the
AC_SYS_LARGEFILE
macro.
aio_suspend
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_suspend.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
off_t
is a 32-bit type, this function may not
work correctly on files larger than 2 GB. The fix is to use the
AC_SYS_LARGEFILE
macro.
aio_write
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_write.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
off_t
is a 32-bit type, this function may not
work correctly on files larger than 2 GB. The fix is to use the
AC_SYS_LARGEFILE
macro.
alarm
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/alarm.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
<io.h>
header on some platforms:
mingw (2012 or newer).
aligned_alloc
Documentation:
man aligned_alloc
Gnulib module: aligned_alloc
Portability problems fixed by Gnulib:
sizeof (void *)
on some platforms:
macOS 11.1, AIX 7.2.
Portability problems not fixed by Gnulib:
The Gnulib module aligned-malloc
provides functions for
allocating and freeing blocks of suitably aligned memory.
The Gnulib module pagealign_alloc
provides a similar API for
allocating and freeing blocks of memory aligned on a system page boundary.
alphasort
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/alphasort.html
Gnulib module: alphasort
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
const void *
on some platforms:
glibc 2.3.6, macOS 10.7, FreeBSD 6.0, NetBSD 7.1, OpenBSD 6.7.
void *
on some platforms:
AIX 5.1.
asctime
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/asctime.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
asctime_r
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/asctime_r.html
Gnulib module: extensions
Portability problems fixed by Gnulib:
_POSIX_PTHREAD_SEMANTICS
is not defined).
Portability problems not fixed by Gnulib:
asin
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/asin.html
Gnulib module: asin
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
asinf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/asinf.html
Gnulib module: asinf
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
asinh
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/asinh.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
asinhf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/asinhf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
asinhl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/asinhl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
asinl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/asinl.html
Gnulib module: asinl
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
assert
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/assert.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
Extension: Gnulib offers a module ‘assert’ that allows the installer to disable assertions through a ‘configure’ option: ‘--disable-assert’.
atan
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/atan.html
Gnulib module: atan
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
atan2
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/atan2.html
Gnulib module: atan2
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
atan2f
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/atan2f.html
Gnulib module: atan2f
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
atan2l
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/atan2l.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
atanf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/atanf.html
Gnulib module: atanf
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
atanh
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/atanh.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
atanhf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/atanhf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
atanhl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/atanhl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
atanl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/atanl.html
Gnulib module: atanl
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
atexit
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/atexit.html
Gnulib module: atexit
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
atof
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/atof.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
atoi
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/atoi.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
atol
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/atol.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
atoll
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/atoll.html
Gnulib module: atoll
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
basename
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/basename.html
LSB specification:
https://refspecs.linuxbase.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/baselib-basename-3.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
basename
: the POSIX
version and the GNU version.
basename
assumes file names in POSIX syntax; it does not work with file
names in Windows syntax.
The Gnulib module basename-lgpl
provides similar API, with a function
last_component
, that also works with Windows file names.
bind
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/bind.html
Gnulib module: bind
Portability problems fixed by Gnulib:
errno
, and WSAGetLastError
must be used
instead.
Portability problems not fixed by Gnulib:
bsearch
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/bsearch.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
btowc
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/btowc.html
Gnulib module: btowc
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
wchar_t
is a 16-bit type and
therefore cannot accommodate all Unicode characters.
However, the Gnulib function btoc32
, provided by Gnulib module
btoc32
, operates on 32-bit wide characters and therefore does not have
this limitation.
mbrtowc
and can return WEOF
:
glibc 2.23, MirOS BSD #10.
c16rtomb
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
c32rtomb
Gnulib module: c32rtomb
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cabs
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cabs.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cabsf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cabsf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cabsl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cabsl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cacos
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cacos.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cacosf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cacosf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cacosh
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cacosh.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cacoshf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cacoshf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cacoshl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cacoshl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cacosl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cacosl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
calloc
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/calloc.html
Gnulib module: calloc-posix
Portability problems fixed by Gnulib:
errno
to ENOMEM
on
some platforms:
mingw, MSVC 14.
calloc (n, s)
can succeed even if
multiplying n
by s
would exceed PTRDIFF_MAX
or
SIZE_MAX
. Although failing to check for exceeding
PTRDIFF_MAX
is arguably allowed by POSIX it can lead to
undefined behavior later, so calloc-posix
does not allow
going over the limit.
Extension: Gnulib provides a module ‘calloc-gnu’ that substitutes a
calloc
implementation that behaves more like the glibc implementation.
It fixes this portability problem:
calloc (0, s)
and calloc (n, 0)
return NULL
on success
on some platforms:
AIX 7.2.
call_once
Documentation:
https://www.gnu.org/software/libc/manual/html_node/Call-Once.html.
Gnulib module: mtx
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
canonicalize
Documentation:
https://www.gnu.org/software/libc/manual/html_node/FP-Bit-Twiddling.html.
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
canonicalizef
Documentation:
https://www.gnu.org/software/libc/manual/html_node/FP-Bit-Twiddling.html.
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
canonicalizel
Documentation:
https://www.gnu.org/software/libc/manual/html_node/FP-Bit-Twiddling.html.
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
carg
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/carg.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cargf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cargf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cargl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cargl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
casin
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/casin.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
casinf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/casinf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
casinh
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/casinh.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
casinhf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/casinhf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
casinhl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/casinhl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
casinl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/casinl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
catan
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/catan.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
catanf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/catanf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
catanh
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/catanh.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
catanhf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/catanhf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
catanhl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/catanhl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
catanl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/catanl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
catclose
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/catclose.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
catgets
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/catgets.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
catopen
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/catopen.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cbrt
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cbrt.html
Gnulib module: cbrt
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cbrtf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cbrtf.html
Gnulib module: cbrtf
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cbrtl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cbrtl.html
Gnulib module: cbrtl or cbrtl-ieee
Portability problems fixed by either Gnulib module cbrtl
or cbrtl-ieee
Portability problems fixed by Gnulib module cbrtl-ieee
:
Portability problems not fixed by Gnulib:
ccos
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ccos.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
ccosf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ccosf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
ccosh
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ccosh.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
ccoshf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ccoshf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
ccoshl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ccoshl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
ccosl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ccosl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
ceil
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ceil.html
Gnulib module: ceil or ceil-ieee
Portability problems fixed by either Gnulib module ceil
or ceil-ieee
:
Portability problems fixed by Gnulib module ceil-ieee
:
Portability problems not fixed by Gnulib:
ceilf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ceilf.html
Gnulib module: ceilf or ceilf-ieee
Portability problems fixed by either Gnulib module ceilf
or ceilf-ieee
:
Portability problems fixed by Gnulib module ceilf-ieee
:
Portability problems not fixed by Gnulib:
ceill
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ceill.html
Gnulib module: ceill or ceill-ieee
Portability problems fixed by either Gnulib module ceill
or ceill-ieee
:
Portability problems fixed by Gnulib module ceill-ieee
:
Portability problems not fixed by Gnulib:
cexp
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cexp.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cexpf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cexpf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cexpl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cexpl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cfgetispeed
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfgetispeed.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cfgetospeed
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfgetospeed.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cfsetispeed
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfsetispeed.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cfsetospeed
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfsetospeed.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
chdir
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/chdir.html
Gnulib module: chdir
Portability problems fixed by Gnulib:
<io.h>
or
<direct.h>
) on some platforms:
mingw, MSVC 14.
Portability problems not fixed by Gnulib:
chmod
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/chmod.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
chown
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html
Gnulib module: chown
Portability problems fixed by Gnulib:
chown("link-to-file/",uid,gid)
:
FreeBSD 7.2, AIX 7.1, Solaris 9.
lchown
.
ENOSYS
:
mingw, MSVC 14.
Portability problems not fixed by Gnulib:
cimag
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cimag.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cimagf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cimagf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cimagl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cimagl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
clearerr
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/clearerr.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
clock
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/clock.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
clock_getcpuclockid
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_getcpuclockid.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
clock_getres
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_getres.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
clock_gettime
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_gettime.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
gettime
is a partial substitute; it
implements the CLOCK_REALTIME
functionality of clock_gettime
.
clock_nanosleep
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_nanosleep.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
clock_settime
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_settime.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
clog
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/clog.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
clogf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/clogf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
clogl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/clogl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
close
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html
Gnulib module: close
Portability problems fixed by Gnulib:
<io.h>
)
on some platforms:
MSVC 14.
socket
and accept
do not return file descriptors that can be closed by close
.
Instead, closesocket
must be used.
Portability problems not fixed by Gnulib:
closedir
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/closedir.html
Gnulib module: closedir
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
closelog
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/closelog.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cnd_broadcast
Documentation:
https://www.gnu.org/software/libc/manual/html_node/ISO-C-Condition-Variables.html.
Gnulib module: cnd
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cnd_destroy
Documentation:
https://www.gnu.org/software/libc/manual/html_node/ISO-C-Condition-Variables.html.
Gnulib module: cnd
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cnd_init
Documentation:
https://www.gnu.org/software/libc/manual/html_node/ISO-C-Condition-Variables.html.
Gnulib module: cnd
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cnd_signal
Documentation:
https://www.gnu.org/software/libc/manual/html_node/ISO-C-Condition-Variables.html.
Gnulib module: cnd
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cnd_timedwait
Documentation:
https://www.gnu.org/software/libc/manual/html_node/ISO-C-Condition-Variables.html.
Gnulib module: cnd
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cnd_wait
Documentation:
https://www.gnu.org/software/libc/manual/html_node/ISO-C-Condition-Variables.html.
Gnulib module: cnd
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
confstr
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/confstr.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
conj
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/conj.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
conjf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/conjf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
conjl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/conjl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
connect
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/connect.html
Gnulib module: connect
Portability problems fixed by Gnulib:
errno
, and WSAGetLastError
must be used
instead.
Portability problems not fixed by Gnulib:
copysign
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/copysign.html
Gnulib module: copysign
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
copysignf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/copysignf.html
Gnulib module: copysignf
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
copysignl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/copysignl.html
Gnulib module: copysignl
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cos
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cos.html
Gnulib module: cos
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cosf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cosf.html
Gnulib module: cosf
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cosh
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cosh.html
Gnulib module: cosh
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
coshf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/coshf.html
Gnulib module: coshf
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
coshl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/coshl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cosl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cosl.html
Gnulib module: cosl
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cpow
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cpow.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cpowf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cpowf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cpowl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cpowl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cproj
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cproj.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cprojf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cprojf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
cprojl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/cprojl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
creal
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/creal.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
crealf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/crealf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
creall
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/creall.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
creat
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/creat.html
Gnulib module: creat
Portability problems fixed by Gnulib:
off_t
is a 32-bit type, creat
may not work
correctly with files larger than 2 GB. (Cf. AC_SYS_LARGEFILE
.)
Portability problems not fixed by Gnulib:
O_TEXT
mode. If you
need a file handle in O_BINARY
mode, you need to use the function
open
instead.
crypt
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/crypt.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
<unistd.h>
(without -D_GNU_SOURCE
) on some platforms:
glibc (at least 2.11–2.13).
csin
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/csin.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
csinf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/csinf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
csinh
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/csinh.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
csinhf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/csinhf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
csinhl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/csinhl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
csinl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/csinl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
csqrt
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/csqrt.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
csqrtf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/csqrtf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
csqrtl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/csqrtl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
ctan
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ctan.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
ctanf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ctanf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
ctanh
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ctanh.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
ctanhf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ctanhf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
ctanhl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ctanhl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
ctanl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ctanl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
ctermid
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ctermid.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
ctime
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ctime.html
Gnulib module: ctime
Portability problems fixed by Gnulib:
TZ
has been set by Cygwin.
Portability problems not fixed by Gnulib:
ctime
function need not be reentrant, and consequently is
not required to be thread safe. Implementations of ctime
typically write the timestamp into static buffer. If two threads
call ctime
at roughly the same time, you might end up with the
wrong date in one of the threads, or some undefined string. There is
a re-entrant interface ctime_r
.
tzset
.
A more flexible function is strftime
. However, note that it is
locale dependent.
ctime_r
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ctime_r.html
Gnulib module: extensions
Portability problems fixed by Gnulib:
_POSIX_PTHREAD_SEMANTICS
is not defined).
Portability problems not fixed by Gnulib:
ctime_r
takes a pre-allocated buffer and length of the buffer,
and returns NULL
on errors.
The input buffer should be at least 26 bytes in size. The output
string is locale-independent. However, years can have more than 4
digits if time_t
is sufficiently wide, so the length of the
required output buffer is not easy to determine. Increasing the
buffer size when ctime_r
returns NULL
is not necessarily
sufficient. The NULL
return value could mean some other error
condition, which will not go away by increasing the buffer size.
A more flexible function is strftime
. However, note that it is
locale dependent.
daddl
Documentation:
https://www.gnu.org/software/libc/manual/html_node/Misc-FP-Arithmetic.html.
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
daylight
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/daylight.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
tzset
.
A more portable way of getting the UTC offset is to use
strftime
with the %z
format. See strftime
.
dbm_clearerr
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/dbm_clearerr.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
dbm_close
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/dbm_close.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
dbm_delete
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/dbm_delete.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
dbm_error
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/dbm_error.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
dbm_fetch
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/dbm_fetch.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
dbm_firstkey
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/dbm_firstkey.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
dbm_nextkey
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/dbm_nextkey.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
dbm_open
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/dbm_open.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
dbm_store
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/dbm_store.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
ddivl
Documentation:
https://www.gnu.org/software/libc/manual/html_node/Misc-FP-Arithmetic.html.
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
difftime
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/difftime.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
dirfd
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/dirfd.html
Gnulib module: dirfd
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
With the dirfd
module, this functions always sets errno
when it
fails. (POSIX does not require that dirfd
sets errno
when it
fails.)
dirname
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/dirname.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
dirname
assumes file names in POSIX syntax; it does not work with file
names in Windows syntax.
The Gnulib module dirname
provides similar API, with functions
dir_name
and mdir_name
, that also works with Windows
file names.
div
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/div.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
dlclose
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/dlclose.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
dlerror
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/dlerror.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
dlopen
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/dlopen.html
LSB specification:
https://refspecs.linuxbase.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/baselib-dlopen-1.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
dlsym
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/dlsym.html
LSB specification:
https://refspecs.linuxbase.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/baselib-dlsym-1.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
dmull
Documentation:
https://www.gnu.org/software/libc/manual/html_node/Misc-FP-Arithmetic.html.
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
dprintf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/dprintf.html
Gnulib module: dprintf or dprintf-posix
Portability problems fixed by either Gnulib module dprintf
or dprintf-posix
:
Portability problems fixed by Gnulib module dprintf-posix
:
"%f"
, "%e"
, "%g"
of Infinity and NaN yields an
incorrect result on some platforms:
Solaris 11.4.
_FORTIFY_SOURCE >= 2
(set by default on Ubuntu),
macOS 11.1.
"%010f"
of NaN and Infinity yields an incorrect result (padded
with zeroes, or wrong capitalization) on some platforms:
Solaris 11.4.
Portability problems not fixed by Gnulib:
%m
directive is not portable, use %s
mapped to an
argument of strerror(errno)
(or a version of strerror_r
)
instead.
errno
or the
stream error indicator on attempts to write to a read-only stream:
Cygwin 1.7.9.
drand48
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/drand48.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
dsubl
Documentation:
https://www.gnu.org/software/libc/manual/html_node/Misc-FP-Arithmetic.html.
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
dup
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup.html
Gnulib module: dup
Portability problems fixed by Gnulib:
<io.h>
)
on some platforms:
MSVC 14.
Portability problems not fixed by Gnulib:
dup2
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup2.html
Gnulib module: dup2
Portability problems fixed by Gnulib:
<io.h>
)
on some platforms:
MSVC 14.
EINVAL
when duplicating an fd to itself:
Android.
FD_CLOEXEC
flag when duplicating an fd
to itself on some platforms:
Haiku.
dup2 (1, 1)
on some platforms:
Cygwin 1.5.x.
-EBADF
instead of -1
on some platforms:
Linux releases between July 2008 and May 2009 (versions 2.6.27 to 2.6.29).
EMFILE
instead of EBADF
for
large targets, which interferes with using
dup2(fd,fd)==fd)
as the minimal EBADF
filter:
AIX 7.1, FreeBSD 6.1, Cygwin 1.5.
Portability problems not fixed by Gnulib:
duplocale
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/duplocale.html
Gnulib module: duplocale
Portability problems fixed by Gnulib:
LC_GLOBAL_LOCALE
is not supported on some platforms:
glibc 2.11, AIX 7.1.
LC_GLOBAL_LOCALE
, this function returns a wrong result
on some platforms:
NetBSD 7.1.
Portability problems not fixed by Gnulib:
locale_t
type is not defined
on some platforms:
z/OS.
encrypt
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/encrypt.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
<unistd.h>
(without -D_GNU_SOURCE
) on some platforms:
glibc (at least 2.11–2.13).
endgrent
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/endgrent.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
endhostent
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/endhostent.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
endnetent
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/endnetent.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
endprotoent
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/endprotoent.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
endpwent
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/endpwent.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
endservent
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/endservent.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
endutxent
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/endutxent.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
environ
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/environ.html
Gnulib module: environ
Portability problems fixed by Gnulib:
extern char **environ;
to get the variable declared. This does not work any more, however, in shared libraries on macOS 11.1. Here is a workaround: Instead, one can use
#include <crt_externs.h> #define environ (*_NSGetEnviron())
This works at all versions of macOS.
-Wl,--disable-auto-import
is in use.
Portability problems not fixed by Gnulib:
environ
to clear all variables is not
portable; better is to assign environ
to one-element array
containing a NULL pointer. That said, an empty environment is not
portable either, as some systems may require particular environment
variables (such as PATH
) to be present in order to operate
consistently.
erand48
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/erand48.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
erf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/erf.html
Gnulib module: erf
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
erfc
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/erfc.html
Gnulib module: erfc
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
erfcf
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/erfcf.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
erfcl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/erfcl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
erff
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/erff.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
erfl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/erfl.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
errno
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/errno.html
Gnulib module: —
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
errno
; their error code is
available through WSAGetLastError()
instead.
execl
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/execl.html
Gnulib module: execl
Portability problems fixed by Gnulib:
intptr_t
, not int
.
Note: The Gnulib replacement for this function is not async-safe, that is, it must not be invoked from a signal handler.
Portability problems not fixed by Gnulib:
execle
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/execle.html
Gnulib module: execle
Portability problems fixed by Gnulib:
intptr_t
, not int
.
Note: The Gnulib replacement for this function is not async-safe, that is, it must not be invoked from a signal handler.
Portability problems not fixed by Gnulib:
execlp
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/execlp.html
Gnulib module: execlp
Portability problems fixed by Gnulib:
intptr_t
, not int
.
Portability problems not fixed by Gnulib:
execv
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/execv.html
Gnulib module: execv
Portability problems fixed by Gnulib:
intptr_t
, not int
.
Note: The Gnulib replacement for this function is not async-safe, that is, it must not be invoked from a signal handler.
Portability problems not fixed by Gnulib:
execve
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/execve.html
Gnulib module: execve
Portability problems fixed by Gnulib:
intptr_t
, not int
.
Note: The Gnulib replacement for this function is not async-safe, that is, it must not be invoked from a signal handler.
Portability problems not fixed by Gnulib:
execvp
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/execvp.html
Gnulib module: execvp
Portability problems fixed by Gnulib:
intptr_t
, not int
.
Portability problems not fixed by Gnulib:
exit
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/exit.html
Gnulib module: stdlib
Portability problems fixed by Gnulib:
EXIT_SUCCESS
and EXIT_FAILURE
,
see stdlib.h.
Portability problems not fixed by Gnulib:
exp
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/exp.html
Gnulib module: exp
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
exp2
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/exp2.html
Gnulib module: exp2
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib: