*** Audits of return values ***

Note: errno is assumed to be set on failure, unless otherwise noted.

fprintf to stdout and stderr are assumed to always be successful.


sysutils.h:

Short:	Function:			errmsg:	Failure:

addtol	add_to_list			yes	NULL
arrcut	array_cut			yes	NULL
arruni	array_union			yes	NULL
backup	backup_file			no	errno
closef	close_file			no	errno
copy	copy_file			no	errno
copym	copy_file_modes			no	errno
creatf	create_filename			no	NULL
mkhome	create_home_directory		yes	NULL
datstr	date_to_string			no	NULL
fputgr	fputgrent			yes	errno
fputpw	fputpwent			yes	errno
fputsg	fputsgent			yes	errno
fputsp	fputspent			yes	errno
getagr	get_admgroups			no	NULL
getalg	get_all_groups			[1]	NULL
getalu	get_all_users			[1]	NULL
getcur	get_current_date		no	-1
getgpm	get_group_primary_members	[1]	NULL
getgra	get_group_admins		no	NULL
getgrm	get_group_members		no	NULL
getgna	get_groupname			[1]	NULL
getgrp	get_groups			no	NULL
getuna	get_username			no	NULL
initlc	init_locales			no	errno
inpstr	input_string			yes	NULL
isbool	is_bool				N/A	EINVAL
iscall	is_caller			yes	-1
isdec	is_decimal			N/A	EINVAL
isgidt	is_gid_t			N/A	EINVAL/ERANGE
isglck	is_group_locked			no	-1
isinar	is_in_array			no	-
islsh	is_listed_shell			N/A	ENOENT
islong	is_long				N/A	EINVAL/ERANGE
isplck	is_password_locked		no	-
isuadm	is_useradmin			[5]	EPERM
isgadm	is_groupadmin			[6]	EPERM/errno
isulck	is_user_locked			no	-1
isdate	is_valid_date			N/A	EINVAL/ERANGE
isgec	is_valid_gecos			N/A	errno/EINVAL
isgecf	is_valid_gecos_field		N/A	EINVAL
isoth	is_valid_gecos_other		N/A	EINVAL
isname	is_valid_name			N/A	EINVAL
isnaml	is_valid_namelist		N/A	EINVAL
ispath	is_valid_path			N/A	errno/ENOTDIR
issh	is_valid_shell			N/A	errno/EINVAL
isstr	is_valid_string			N/A	EINVAL
isuidt	is_uid_t			N/A	EINVAL/ERANGE
joing	join_gecos			no
lockf	lock_files			no	errno
openf	open_file			no	NULL
ulockf	unlock_files			no	errno
parse	parse_key_pairs			[2]	(1)
repl	replace_file			no	errno
listrm	remove_from_list		no	NULL
setimo	set_input_mode			yes	errno
splitg	split_gecos			no	NULL
2bool	string_to_bool			no	-
2date	string_to_date			yes	errno
2gidt	string_to_gid_t			yes	errno
2long	string_to_long			yes	errno
2str	string_to_string		yes	errno
2uidt	string_to_uid_t			yes	errno
uniadd	uniq_add_to_list		yes	NULL
unlnf	unlink_file			no	errno
version	version				no	-


misc.h:

Short:	Function:			errmsg:	Failure:

strspl	strsplit			yes	NULL
strcon	strconcat			yes	NULL
strjoi	strjoin				yes	NULL
strjov	strjoinv			yes	NULL
strfrv	strfreev			no	-


external functions:

Short:	Function:			errmsg:	Failure:

access	access				yes	-1
atexit	atexit				[3]	non-zero (2)
bindtd	bindtextdomain			[4]	NULL
calloc	calloc				yes	NULL
chmod	chmod				yes	-1
chown	chown				yes	-1
fclose	fclose				yes	EOF
fgetc	fgetc				no	EOF
fopen	fopen				yes	NULL
fputc	fputc				no	EOF
free	free				no	-
getgrg	getgrgid			yes	NULL
getgrn	getgrnam			yes	NULL
getpwu	getpwuid			yes	NULL
getpwn	getpwnam			yes	NULL
getsgn	getsgnam			yes	NULL
getspn	getspnam			yes	NULL
gmtimr	gmtime_r			yes	NULL
isalph	isalpha				N/A	-
iscntr	iscntrl				N/A	-
isprin	isprint				N/A	-
isspac	isspace				N/A	-
lchown	lchown				yes	-1
link	link				yes	-1
lstat	lstat				yes	-1
malloc	malloc				yes	NULL
memcpy	memcpy				no	-
mkdir	mkdir				yes	-1
read	read				yes	-1
realloc	realloc				yes	NULL
rename	rename				yes	-1
setloc	setlocale			no	(3)
stat	stat				yes	-1
strchr	strchr				N/A	-
strcmp	strcmp				N/A	-
strdup	strdup				yes	NULL
strlen	strlen				N/A	-
strncm	strncmp				N/A	-
strerr	strerror			no	(4)
strrch	strrchr				N/A	-
strstr	strstr				N/A	-
tcseta	tcsetattr			yes	-1
tcgeta	tcgetattr			yes	-1
textd	textdomain			[4]	NULL
time	time				yes	((time_t)-1)
umask	umask				no	-
unlink	unlink				yes	-1


errmsg: 

yes	Error-message always needed
no	Error-message provided by the function
-	Never fails
[1]	Usage specific; usually only if (!strlen(retval)) is considered bad
[2]	if (retval == ENOENT)
[3]	Warning instead of error
[4]	if (!retval && errno == ENOMEM)
[5]	Only if EPERM is considered harmful
[6]	Always if errno != EPERM, otherwise only if EPERM is considered harmful

Failure:

(1)	EINVAL on invalid syntax, ENOENT if no such attribute,
	errno on external failure
(2)	errno is NOT set
(3)	It seems that setlocale(LC_ALL, "") never fails,
	but I have yet to confirms this
(4)	strerror() can fail with EINVAL if supplied with an invalid errnum,
	but we accept this, since strerror will still return an error-message
