alphasort and scandir
These routines combine the functions of readdir and qsort to process directory information. scandir reads a directory and builds an array of pointers to directory entries, returning the number of entries in the array and a pointer to the array through the parameter, namelist. namelist is a pointer to an arrangement of directory structure pointers. If the directory cannot be opened for reading or if malloc cannot allocate enough memory to hold all the data structures, scandir returns -1. alphasort is a routine that alphabetically sorts an array of pointers to directory entries (built by the routine, scandir).
These routines are not available in the default SunOS 5.x release.
bcmp, bcopy, and bzero
Functionally equivalent to the memcmp, memcpy, and memset routines, see memory(3C). bcopy copies bytes, handling overlapping strings correctly. bcmp compares bytes, returning zero if they are identical, non-zero otherwise. bzero zeros out bytes. These routines are not available in the default SunOS 5.x release.
fopen and freopen
The SunOS 5.x and SunOS 4.1 versions differ in the handling of the a type. If mode a is specified, the SunOS 5.x version opens the file with O_APPEND set, while the SunOS 4.1 version doesn't. Also, the SunOS 4.1version always seeks to the end of the file when mode a is specified, while the SunOS 5.x version seeks to the end of the file if update mode is not specified.
ftime
Returns a structure that contains elements showing the elapsed time since the epoch (00:00:00, January 1st, 1970). See ctime(3C). This routine is not available in the default SunOS 5.x release.
getwd
Similar to getcwd. getwd returns the pathname of the current working directory, or NULL if there is an error. The return value of getwd is placed in a character string allocated by the caller. This routine is not available in the default SunOS 5.x release.
index and rindex
index returns a pointer to the first occurrence of a single character in a null-terminated character string. If the character does not occur in the string, index returns a NULL pointer. In the SunOS 5.x release, strchr replaces index, see string(3C).
rindex returns a pointer to the last occurrence of a single character in a null-terminated string, or a NULL pointer if the letter does not occur in the string. In the SunOS 5.x release, strrchr replaces rindex, see string(3C).
These routines are not available in the default SunOS 5.x release.
initstate, random, setstate, and srandom
Random number generator routines relied on by many user programs in the SunOS 4.1 release. These routines are not available in the default SunOS 5.x release.
See rand(3C), srand(3C), and drand(3C) in the SunOS Reference Manual.
nice
The SunOS 4.1 version always returns 0 if successful. The SunOS 5.x version returns the new nice value minus 20.
nlist
If unsuccessful, returns the number of symbols that were not located in the symbol table. (The SunOS 5.x version returns -1 if unsuccessful.) Also, nlist takes a file name as an argument, rather than a file descriptor.
printf, fprintf, sprintf, vfprintf, vprintf, and vsprintf
The following differences exist for these functions:
In the SunOS 4.1 release, sprintf returns a pointer to its first argument; in the SunOS 5.x release, it returns the count of characters printed.
In the SunOS 4.1 release, printf and vprintf always return the number of characters printed or EOF, while the SunOS 5.x version returns only EOF in case of an error.
fprintf and vfprintf share the same differences as printf and vprintf (above); additionally, the buffering scheme for these routines is different for the SunOS 5.x and SunOS 4.1 release.
rand and srand
The SunOS 5.x returns the generated number shifted to the right by 16 and anded with 0x7fff, while the SunOS 4.1 release returns the generated number anded with 0x7fffffff.
re_comp and re_exec
These routines are similar to the regcmp(3G) and regex routines. re_comp compiles the regular expression in a string, returning 0 if it compiled successfully or returning a pointer to an error message if it did not. regcmp, on the other hand, returns a pointer to the compiled form or NULL if given an incorrect argument. re_exec returns 1 if the string s matches the last compiled regular expression, 0 if it fails to match, and -1 if the regular expression is invalid. regex, however, returns NULL on failure or a pointer to the next unmatched character on success.
readdir
Reads a directory entry. The SunOS 4.1 release readdir routine returns a pointer to struct direct, while the SunOS 5.x version returns a pointer to struct dirent.
setbuffer and setlinebuf
These routines are used to provide control over the buffering used for input and output.
Similar to setbuf(3S) and setvbuf, setbuffer may be used after a stream has been opened but before it is read or written. It uses the array pointer instead of an automatically allocated buffer. If the buffer is the NULL pointer, input/output is completely unbuffered.
setlinebuf is used to change the buffering on a stream from block buffered or unbuffered to line buffered. It can be used at any time that the file descriptor is active.
These routines are not available in the default SunOS 5.x release.
sleep
The SunOS 5.x version returns the ``unslept'' amount, that is, the requested time minus the time actually slept. The SunOS 4.1 version does not return anything.
sys_siglist
An array containing a message string for each SunOS 4.1 signal number.
times
The SunOS 4.1 version returns 0 when successful. The SunOS 5.x version returns the elapsed real time in clock ticks per second from an arbitrary point in the past.
ualarm and usleep
Simplified interfaces to the system calls handling high-resolution timers. These routines are not available in the default SunOS 5.x release.