2004-09-17  Ulrich Drepper  <drepper@redhat.com>

	* misc/sys/cdefs.h: Define __nonnull using nonnull function attribute
	for gcc 3.3 and higher.
	* io/fcntl.h: Add __nonnull where appropriate.
	* io/ftw.h: Likewise.
	* io/utime.h: Likewise.
	* io/sys/poll.h: Likewise.
	* io/sys/sendfile.h: Likewise.
	* io/sys/stat.h: Likewise.
	* io/sys/statfs.h: Likewise.
	* io/sys/statvfs.h: Likewise.
	* posix/unistd.h: Likewise.
This commit is contained in:
Ulrich Drepper 2004-09-17 08:44:34 +00:00
parent 5032f49422
commit 8a1f658bd7
11 changed files with 176 additions and 90 deletions

View File

@ -1,3 +1,17 @@
2004-09-17 Ulrich Drepper <drepper@redhat.com>
* misc/sys/cdefs.h: Define __nonnull using nonnull function attribute
for gcc 3.3 and higher.
* io/fcntl.h: Add __nonnull where appropriate.
* io/ftw.h: Likewise.
* io/utime.h: Likewise.
* io/sys/poll.h: Likewise.
* io/sys/sendfile.h: Likewise.
* io/sys/stat.h: Likewise.
* io/sys/statfs.h: Likewise.
* io/sys/statvfs.h: Likewise.
* posix/unistd.h: Likewise.
2004-09-16 Ulrich Drepper <drepper@redhat.com>
* posix/glob.h: Remove cruft to make header usable outside glibc.

22
NEWS
View File

@ -9,6 +9,28 @@ Version 2.3.4
* Support for RFC 3678. Real implementations exist only for Linux so far.
Implemented by Ulrich Drepper.
* nscd can now cache entries persistently. Expiring entries are reloaded.
For speedups the cache can be shared in memory with client processes.
Implemented by Ulrich Drepper.
* nscd can now perform SELinux checks.
Implemented by Matthew Rickard <mjricka@epoch.ncsc.mil>.
* getaddrinfo queries are not cached. Canonical name lookup is performed
efficiently.
Implemented by Ulrich Drepper.
* The nothrow function attribute is used when headers are used by gcc when
compiling C code. This can avoid significant amounts of exception
handling data.
* The malloc functions perform more error checking and are stricter when
it comes to reacting on errors. The default action is to terminate
the process after showing an error message.
* Reverse lookups of IPv6 addresses does not use bit string or .ip6.int
lookups anymore unless explicitly requested.
Version 2.3.3

View File

@ -69,16 +69,17 @@ extern int fcntl (int __fd, int __cmd, ...);
This function is a cancellation point and therefore not marked with
__THROW. */
#ifndef __USE_FILE_OFFSET64
extern int open (__const char *__file, int __oflag, ...);
extern int open (__const char *__file, int __oflag, ...) __nonnull ((1));
#else
# ifdef __REDIRECT
extern int __REDIRECT (open, (__const char *__file, int __oflag, ...), open64);
extern int __REDIRECT (open, (__const char *__file, int __oflag, ...), open64)
__nonnull ((1));
# else
# define open open64
# endif
#endif
#ifdef __USE_LARGEFILE64
extern int open64 (__const char *__file, int __oflag, ...);
extern int open64 (__const char *__file, int __oflag, ...) __nonnull ((1));
#endif
/* Create and open FILE, with mode MODE. This takes an `int' MODE
@ -87,17 +88,17 @@ extern int open64 (__const char *__file, int __oflag, ...);
This function is a cancellation point and therefore not marked with
__THROW. */
#ifndef __USE_FILE_OFFSET64
extern int creat (__const char *__file, __mode_t __mode);
extern int creat (__const char *__file, __mode_t __mode) __nonnull ((1));
#else
# ifdef __REDIRECT
extern int __REDIRECT (creat, (__const char *__file, __mode_t __mode),
creat64);
creat64) __nonnull ((1));
# else
# define creat creat64
# endif
#endif
#ifdef __USE_LARGEFILE64
extern int creat64 (__const char *__file, __mode_t __mode);
extern int creat64 (__const char *__file, __mode_t __mode) __nonnull ((1));
#endif
#if !defined F_LOCK && (defined __USE_MISC || (defined __USE_XOPEN_EXTENDED \

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1992,1996,1997,1998,1999,2003 Free Software Foundation, Inc.
/* Copyright (C) 1992,1996-1999,2003,2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -134,18 +134,19 @@ typedef int (*__nftw64_func_t) (__const char *__filename,
This function is a possible cancellation point and therefore not
marked with __THROW. */
#ifndef __USE_FILE_OFFSET64
extern int ftw (__const char *__dir, __ftw_func_t __func, int __descriptors);
extern int ftw (__const char *__dir, __ftw_func_t __func, int __descriptors)
__nonnull ((1, 2));
#else
# ifdef __REDIRECT
extern int __REDIRECT (ftw, (__const char *__dir, __ftw_func_t __func,
int __descriptors), ftw64);
int __descriptors), ftw64) __nonnull ((1, 2));
# else
# define ftw ftw64
# endif
#endif
#ifdef __USE_LARGEFILE64
extern int ftw64 (__const char *__dir, __ftw64_func_t __func,
int __descriptors);
int __descriptors) __nonnull ((1, 2));
#endif
#ifdef __USE_XOPEN_EXTENDED
@ -156,18 +157,19 @@ extern int ftw64 (__const char *__dir, __ftw64_func_t __func,
marked with __THROW. */
# ifndef __USE_FILE_OFFSET64
extern int nftw (__const char *__dir, __nftw_func_t __func, int __descriptors,
int __flag);
int __flag) __nonnull ((1, 2));
# else
# ifdef __REDIRECT
extern int __REDIRECT (nftw, (__const char *__dir, __nftw_func_t __func,
int __descriptors, int __flag), nftw64);
int __descriptors, int __flag), nftw64)
__nonnull ((1, 2));
# else
# define nftw nftw64
# endif
# endif
# ifdef __USE_LARGEFILE64
extern int nftw64 (__const char *__dir, __nftw64_func_t __func,
int __descriptors, int __flag);
int __descriptors, int __flag) __nonnull ((1, 2));
# endif
#endif

View File

@ -32,19 +32,19 @@ __BEGIN_DECLS
case of error. */
#ifndef __USE_FILE_OFFSET64
extern ssize_t sendfile (int __out_fd, int __in_fd, off_t *__offset,
size_t __count) __THROW;
size_t __count) __THROW __nonnull ((3));
#else
# ifdef __REDIRECT_NTH
extern ssize_t __REDIRECT_NTH (sendfile,
(int __out_fd, int __in_fd, __off64_t *__offset,
size_t __count), sendfile64);
size_t __count), sendfile64) __nonnull ((3));
# else
# define sendfile sendfile64
# endif
#endif
#ifdef __USE_LARGEFILE64
extern ssize_t sendfile64 (int __out_fd, int __in_fd, __off64_t *__offset,
size_t __count) __THROW;
size_t __count) __THROW __nonnull ((3));
#endif
__END_DECLS

View File

@ -205,16 +205,18 @@ __BEGIN_DECLS
#ifndef __USE_FILE_OFFSET64
/* Get file attributes for FILE and put them in BUF. */
extern int stat (__const char *__restrict __file,
struct stat *__restrict __buf) __THROW;
struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
/* Get file attributes for the file, device, pipe, or socket
that file descriptor FD is open on and put them in BUF. */
extern int fstat (int __fd, struct stat *__buf) __THROW;
extern int fstat (int __fd, struct stat *__buf) __THROW __nonnull ((2));
#else
# ifdef __REDIRECT_NTH
extern int __REDIRECT_NTH (stat, (__const char *__restrict __file,
struct stat *__restrict __buf), stat64);
extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), fstat64);
struct stat *__restrict __buf), stat64)
__nonnull ((1, 2));
extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), fstat64)
__nonnull ((2));
# else
# define stat stat64
# define fstat fstat64
@ -222,8 +224,8 @@ extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), fstat64);
#endif
#ifdef __USE_LARGEFILE64
extern int stat64 (__const char *__restrict __file,
struct stat64 *__restrict __buf) __THROW;
extern int fstat64 (int __fd, struct stat64 *__buf) __THROW;
struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2));
extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2));
#endif
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
@ -231,31 +233,35 @@ extern int fstat64 (int __fd, struct stat64 *__buf) __THROW;
/* Get file attributes about FILE and put them in BUF.
If FILE is a symbolic link, do not follow it. */
extern int lstat (__const char *__restrict __file,
struct stat *__restrict __buf) __THROW;
struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
# else
# ifdef __REDIRECT_NTH
extern int __REDIRECT_NTH (lstat,
(__const char *__restrict __file,
struct stat *__restrict __buf), lstat64);
struct stat *__restrict __buf), lstat64)
__nonnull ((1, 2));
# else
# define lstat lstat64
# endif
# endif
# ifdef __USE_LARGEFILE64
extern int lstat64 (__const char *__restrict __file,
struct stat64 *__restrict __buf) __THROW;
struct stat64 *__restrict __buf)
__THROW __nonnull ((1, 2));
# endif
#endif
/* Set file access permissions for FILE to MODE.
If FILE is a symbolic link, this affects its target instead. */
extern int chmod (__const char *__file, __mode_t __mode) __THROW;
extern int chmod (__const char *__file, __mode_t __mode)
__THROW __nonnull ((1));
#ifdef __USE_BSD
/* Set file access permissions for FILE to MODE.
If FILE is a symbolic link, this affects the link itself
rather than its target. */
extern int lchmod (__const char *__file, __mode_t __mode) __THROW;
extern int lchmod (__const char *__file, __mode_t __mode)
__THROW __nonnull ((1));
#endif
/* Set file access permissions of the file FD is open on to MODE. */
@ -275,19 +281,21 @@ extern __mode_t getumask (void) __THROW;
#endif
/* Create a new directory named PATH, with permission bits MODE. */
extern int mkdir (__const char *__path, __mode_t __mode) __THROW;
extern int mkdir (__const char *__path, __mode_t __mode)
__THROW __nonnull ((1));
/* Create a device file named PATH, with permission and special bits MODE
and device number DEV (which can be constructed from major and minor
device numbers with the `makedev' macro above). */
#if defined __USE_MISC || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
extern int mknod (__const char *__path, __mode_t __mode, __dev_t __dev)
__THROW;
__THROW __nonnull ((1));
#endif
/* Create a new FIFO named PATH, with permission bits MODE. */
extern int mkfifo (__const char *__path, __mode_t __mode) __THROW;
extern int mkfifo (__const char *__path, __mode_t __mode)
__THROW __nonnull ((1));
/* To allow the `struct stat' structure and the file type `mode_t'
bits to vary without changing shared library major version number,
@ -313,19 +321,23 @@ extern int mkfifo (__const char *__path, __mode_t __mode) __THROW;
/* Wrappers for stat and mknod system calls. */
#ifndef __USE_FILE_OFFSET64
extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf) __THROW;
extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf)
__THROW __nonnull ((3));
extern int __xstat (int __ver, __const char *__filename,
struct stat *__stat_buf) __THROW;
struct stat *__stat_buf) __THROW __nonnull ((2, 3));
extern int __lxstat (int __ver, __const char *__filename,
struct stat *__stat_buf) __THROW;
struct stat *__stat_buf) __THROW __nonnull ((2, 3));
#else
# ifdef __REDIRECT_NTH
extern int __REDIRECT_NTH (__fxstat, (int __ver, int __fildes,
struct stat *__stat_buf), __fxstat64);
struct stat *__stat_buf), __fxstat64)
__nonnull ((3));
extern int __REDIRECT_NTH (__xstat, (int __ver, __const char *__filename,
struct stat *__stat_buf), __xstat64);
struct stat *__stat_buf), __xstat64)
__nonnull ((2, 3));
extern int __REDIRECT_NTH (__lxstat, (int __ver, __const char *__filename,
struct stat *__stat_buf), __lxstat64);
struct stat *__stat_buf), __lxstat64)
__nonnull ((2, 3));
# else
# define __fxstat __fxstat64
@ -336,14 +348,14 @@ extern int __REDIRECT_NTH (__lxstat, (int __ver, __const char *__filename,
#ifdef __USE_LARGEFILE64
extern int __fxstat64 (int __ver, int __fildes, struct stat64 *__stat_buf)
__THROW;
__THROW __nonnull ((3));
extern int __xstat64 (int __ver, __const char *__filename,
struct stat64 *__stat_buf) __THROW;
struct stat64 *__stat_buf) __THROW __nonnull ((2, 3));
extern int __lxstat64 (int __ver, __const char *__filename,
struct stat64 *__stat_buf) __THROW;
struct stat64 *__stat_buf) __THROW __nonnull ((2, 3));
#endif
extern int __xmknod (int __ver, __const char *__path, __mode_t __mode,
__dev_t *__dev) __THROW;
__dev_t *__dev) __THROW __nonnull ((2, 4));
#if defined __GNUC__ && __GNUC__ >= 2
/* Inlined versions of the real stat and mknod functions. */

View File

@ -29,34 +29,38 @@ __BEGIN_DECLS
/* Return information about the filesystem on which FILE resides. */
#ifndef __USE_FILE_OFFSET64
extern int statfs (__const char *__file, struct statfs *__buf) __THROW;
extern int statfs (__const char *__file, struct statfs *__buf)
__THROW __nonnull ((1, 2));
#else
# ifdef __REDIRECT_NTH
extern int __REDIRECT_NTH (statfs,
(__const char *__file, struct statfs *__buf),
statfs64);
statfs64) __nonnull ((1, 2));
# else
# define statfs statfs64
# endif
#endif
#ifdef __USE_LARGEFILE64
extern int statfs64 (__const char *__file, struct statfs64 *__buf) __THROW;
extern int statfs64 (__const char *__file, struct statfs64 *__buf)
__THROW __nonnull ((1, 2));
#endif
/* Return information about the filesystem containing the file FILDES
refers to. */
#ifndef __USE_FILE_OFFSET64
extern int fstatfs (int __fildes, struct statfs *__buf) __THROW;
extern int fstatfs (int __fildes, struct statfs *__buf)
__THROW __nonnull ((2));
#else
# ifdef __REDIRECT_NTH
extern int __REDIRECT_NTH (fstatfs, (int __fildes, struct statfs *__buf),
fstatfs64);
fstatfs64) __nonnull ((2));
# else
# define fstatfs fstatfs64
# endif
#endif
#ifdef __USE_LARGEFILE64
extern int fstatfs64 (int __fildes, struct statfs64 *__buf) __THROW;
extern int fstatfs64 (int __fildes, struct statfs64 *__buf)
__THROW __nonnull ((2));
#endif
__END_DECLS

View File

@ -50,35 +50,40 @@ __BEGIN_DECLS
/* Return information about the filesystem on which FILE resides. */
#ifndef __USE_FILE_OFFSET64
extern int statvfs (__const char *__restrict __file,
struct statvfs *__restrict __buf) __THROW;
struct statvfs *__restrict __buf)
__THROW __nonnull ((1, 2));
#else
# ifdef __REDIRECT_NTH
extern int __REDIRECT_NTH (statvfs,
(__const char *__restrict __file,
struct statvfs *__restrict __buf), statvfs64);
struct statvfs *__restrict __buf), statvfs64)
__nonnull ((1, 2));
# else
# define statvfs statvfs64
# endif
#endif
#ifdef __USE_LARGEFILE64
extern int statvfs64 (__const char *__restrict __file,
struct statvfs64 *__restrict __buf) __THROW;
struct statvfs64 *__restrict __buf)
__THROW __nonnull ((1, 2));
#endif
/* Return information about the filesystem containing the file FILDES
refers to. */
#ifndef __USE_FILE_OFFSET64
extern int fstatvfs (int __fildes, struct statvfs *__buf) __THROW;
extern int fstatvfs (int __fildes, struct statvfs *__buf)
__THROW __nonnull ((2));
#else
# ifdef __REDIRECT_NTH
extern int __REDIRECT_NTH (fstatvfs, (int __fildes, struct statvfs *__buf),
fstatvfs64);
fstatvfs64) __nonnull ((2));
# else
# define fstatvfs fstatvfs64
# endif
#endif
#ifdef __USE_LARGEFILE64
extern int fstatvfs64 (int __fildes, struct statvfs64 *__buf) __THROW;
extern int fstatvfs64 (int __fildes, struct statvfs64 *__buf)
__THROW __nonnull ((2));
#endif
__END_DECLS

View File

@ -44,7 +44,8 @@ struct utimbuf
/* Set the access and modification times of FILE to those given in
*FILE_TIMES. If FILE_TIMES is NULL, set them to the current time. */
extern int utime (__const char *__file,
__const struct utimbuf *__file_times) __THROW;
__const struct utimbuf *__file_times)
__THROW __nonnull ((1, 2));
__END_DECLS

View File

@ -242,6 +242,14 @@
# define __attribute_format_strfmon__(a,b) /* Ignore */
#endif
/* The nonull function attribute allows to mark pointer parameters which
must not be NULL. */
#if __GNUC_PREREQ (3,3)
# define __nonnull(params) __attribute__ ((__nonnull__ params))
#else
# define __nonnull(params)
#endif
/* It is possible to compile containing GCC extensions even if GCC is
run in pedantic mode if the uses are carefully marked using the
`__extension__' keyword. But this is not generally available before

View File

@ -253,12 +253,13 @@ typedef __socklen_t socklen_t;
#define F_OK 0 /* Test for existence. */
/* Test for access to NAME using the real UID and real GID. */
extern int access (__const char *__name, int __type) __THROW;
extern int access (__const char *__name, int __type) __THROW __nonnull ((1));
#ifdef __USE_GNU
/* Test for access to NAME using the effective UID and GID
(as normal file operations use). */
extern int euidaccess (__const char *__name, int __type) __THROW;
extern int euidaccess (__const char *__name, int __type)
__THROW __nonnull ((1));
#endif
@ -415,7 +416,7 @@ extern int pause (void);
/* Change the owner and group of FILE. */
extern int chown (__const char *__file, __uid_t __owner, __gid_t __group)
__THROW;
__THROW __nonnull ((1));
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
/* Change the owner and group of the file that FD is open on. */
@ -425,12 +426,12 @@ extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __THROW;
/* Change owner and group of FILE, if it is a symbolic
link the ownership of the symbolic link is changed. */
extern int lchown (__const char *__file, __uid_t __owner, __gid_t __group)
__THROW;
__THROW __nonnull ((1));
#endif /* Use BSD || X/Open Unix. */
/* Change the process's working directory to PATH. */
extern int chdir (__const char *__path) __THROW;
extern int chdir (__const char *__path) __THROW __nonnull ((1));
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
/* Change the process's working directory to the one FD is open on. */
@ -457,7 +458,7 @@ extern char *get_current_dir_name (void) __THROW;
/* Put the absolute pathname of the current working directory in BUF.
If successful, return BUF. If not, put an error message in
BUF and return NULL. BUF should be at least PATH_MAX bytes long. */
extern char *getwd (char *__buf) __THROW;
extern char *getwd (char *__buf) __THROW __nonnull ((1));
#endif
@ -477,7 +478,7 @@ extern char **environ;
/* Replace the current process, executing PATH with arguments ARGV and
environment ENVP. ARGV and ENVP are terminated by NULL pointers. */
extern int execve (__const char *__path, char *__const __argv[],
char *__const __envp[]) __THROW;
char *__const __envp[]) __THROW __nonnull ((1));
#ifdef __USE_GNU
/* Execute the file FD refers to, overlaying the running program image.
@ -488,24 +489,29 @@ extern int fexecve (int __fd, char *__const __argv[], char *__const __envp[])
/* Execute PATH with arguments ARGV and environment from `environ'. */
extern int execv (__const char *__path, char *__const __argv[]) __THROW;
extern int execv (__const char *__path, char *__const __argv[])
__THROW __nonnull ((1));
/* Execute PATH with all arguments after PATH until a NULL pointer,
and the argument after that for environment. */
extern int execle (__const char *__path, __const char *__arg, ...) __THROW;
extern int execle (__const char *__path, __const char *__arg, ...)
__THROW __nonnull ((1));
/* Execute PATH with all arguments after PATH until
a NULL pointer and environment from `environ'. */
extern int execl (__const char *__path, __const char *__arg, ...) __THROW;
extern int execl (__const char *__path, __const char *__arg, ...)
__THROW __nonnull ((1));
/* Execute FILE, searching in the `PATH' environment variable if it contains
no slashes, with arguments ARGV and environment from `environ'. */
extern int execvp (__const char *__file, char *__const __argv[]) __THROW;
extern int execvp (__const char *__file, char *__const __argv[])
__THROW __nonnull ((1));
/* Execute FILE, searching in the `PATH' environment variable if
it contains no slashes, with all arguments after FILE until a
NULL pointer and environment from `environ'. */
extern int execlp (__const char *__file, __const char *__arg, ...) __THROW;
extern int execlp (__const char *__file, __const char *__arg, ...)
__THROW __nonnull ((1));
#if defined __USE_MISC || defined __USE_XOPEN
@ -524,7 +530,8 @@ extern void _exit (int __status) __attribute__ ((__noreturn__));
#include <bits/confname.h>
/* Get file-specific configuration information about PATH. */
extern long int pathconf (__const char *__path, int __name) __THROW;
extern long int pathconf (__const char *__path, int __name)
__THROW __nonnull ((1));
/* Get file-specific configuration about descriptor FD. */
extern long int fpathconf (int __fd, int __name) __THROW;
@ -702,7 +709,8 @@ extern char *ttyname (int __fd) __THROW;
/* Store at most BUFLEN characters of the pathname of the terminal FD is
open on in BUF. Return 0 on success, otherwise an error number. */
extern int ttyname_r (int __fd, char *__buf, size_t __buflen) __THROW;
extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
__THROW __nonnull ((2));
/* Return 1 if FD is a valid descriptor associated
with a terminal, zero if not. */
@ -717,24 +725,26 @@ extern int ttyslot (void) __THROW;
/* Make a link to FROM named TO. */
extern int link (__const char *__from, __const char *__to) __THROW;
extern int link (__const char *__from, __const char *__to)
__THROW __nonnull ((1, 2));
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
/* Make a symbolic link to FROM named TO. */
extern int symlink (__const char *__from, __const char *__to) __THROW;
extern int symlink (__const char *__from, __const char *__to)
__THROW __nonnull ((1, 2));
/* Read the contents of the symbolic link PATH into no more than
LEN bytes of BUF. The contents are not null-terminated.
Returns the number of characters read, or -1 for errors. */
extern int readlink (__const char *__restrict __path, char *__restrict __buf,
size_t __len) __THROW;
size_t __len) __THROW __nonnull ((1, 2));
#endif /* Use BSD. */
/* Remove the link NAME. */
extern int unlink (__const char *__name) __THROW;
extern int unlink (__const char *__name) __THROW __nonnull ((1));
/* Remove the directory PATH. */
extern int rmdir (__const char *__path) __THROW;
extern int rmdir (__const char *__path) __THROW __nonnull ((1));
/* Return the foreground process group ID of FD. */
@ -756,12 +766,12 @@ extern char *getlogin (void);
This function is a possible cancellation points and therefore not
marked with __THROW. */
extern int getlogin_r (char *__name, size_t __name_len);
extern int getlogin_r (char *__name, size_t __name_len) __nonnull ((1));
#endif
#ifdef __USE_BSD
/* Set the login name returned by `getlogin'. */
extern int setlogin (__const char *__name) __THROW;
extern int setlogin (__const char *__name) __THROW __nonnull ((1));
#endif
@ -778,14 +788,15 @@ extern int setlogin (__const char *__name) __THROW;
/* Put the name of the current host in no more than LEN bytes of NAME.
The result is null-terminated if LEN is large enough for the full
name and the terminator. */
extern int gethostname (char *__name, size_t __len) __THROW;
extern int gethostname (char *__name, size_t __len) __THROW __nonnull ((1));
#endif
#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
/* Set the name of the current host to NAME, which is LEN bytes long.
This call is restricted to the super-user. */
extern int sethostname (__const char *__name, size_t __len) __THROW;
extern int sethostname (__const char *__name, size_t __len)
__THROW __nonnull ((1));
/* Set the current machine's Internet number to ID.
This call is restricted to the super-user. */
@ -795,8 +806,10 @@ extern int sethostid (long int __id) __THROW;
/* Get and set the NIS (aka YP) domain name, if any.
Called just like `gethostname' and `sethostname'.
The NIS domain name is usually the empty string when not using NIS. */
extern int getdomainname (char *__name, size_t __len) __THROW;
extern int setdomainname (__const char *__name, size_t __len) __THROW;
extern int getdomainname (char *__name, size_t __len)
__THROW __nonnull ((1));
extern int setdomainname (__const char *__name, size_t __len)
__THROW __nonnull ((1));
/* Revoke access permissions to all processes currently communicating
@ -805,7 +818,7 @@ extern int setdomainname (__const char *__name, size_t __len) __THROW;
extern int vhangup (void) __THROW;
/* Revoke the access of all descriptors currently open on FILE. */
extern int revoke (__const char *__file) __THROW;
extern int revoke (__const char *__file) __THROW __nonnull ((1));
/* Enable statistical profiling, writing samples of the PC into at most
@ -814,13 +827,14 @@ extern int revoke (__const char *__file) __THROW;
SAMPLE_BUFFER[((PC - OFFSET) / 2) * SCALE / 65536]. If SCALE is zero,
disable profiling. Returns zero on success, -1 on error. */
extern int profil (unsigned short int *__sample_buffer, size_t __size,
size_t __offset, unsigned int __scale) __THROW;
size_t __offset, unsigned int __scale)
__THROW __nonnull ((1));
/* Turn accounting on if NAME is an existing file. The system will then write
a record for each process as it terminates, to this file. If NAME is NULL,
turn accounting off. This call is restricted to the super-user. */
extern int acct (__const char *__name) __THROW;
extern int acct (__const char *__name) __THROW __nonnull ((1));
/* Successive calls return the shells listed in `/etc/shells'. */
@ -839,11 +853,11 @@ extern int daemon (int __nochdir, int __noclose) __THROW;
#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
/* Make PATH be the root directory (the starting point for absolute paths).
This call is restricted to the super-user. */
extern int chroot (__const char *__path) __THROW;
extern int chroot (__const char *__path) __THROW __nonnull ((1));
/* Prompt with PROMPT and read a string from the terminal without echoing.
Uses /dev/tty if possible; otherwise stderr and stdin. */
extern char *getpass (__const char *__prompt);
extern char *getpass (__const char *__prompt) __nonnull ((1));
#endif /* Use BSD || X/Open. */
@ -872,18 +886,20 @@ extern int getpagesize (void) __THROW __attribute__ ((__const__));
/* Truncate FILE to LENGTH bytes. */
# ifndef __USE_FILE_OFFSET64
extern int truncate (__const char *__file, __off_t __length) __THROW;
extern int truncate (__const char *__file, __off_t __length)
__THROW __nonnull ((1));
# else
# ifdef __REDIRECT_NTH
extern int __REDIRECT_NTH (truncate,
(__const char *__file, __off64_t __length),
truncate64);
truncate64) __nonnull ((1));
# else
# define truncate truncate64
# endif
# endif
# ifdef __USE_LARGEFILE64
extern int truncate64 (__const char *__file, __off64_t __length) __THROW;
extern int truncate64 (__const char *__file, __off64_t __length)
__THROW __nonnull ((1));
# endif
/* Truncate the file FD is open on to LENGTH bytes. */
@ -996,11 +1012,12 @@ extern int fdatasync (int __fildes) __THROW;
be defined here. */
#ifdef __USE_XOPEN
/* Encrypt at most 8 characters from KEY using salt to perturb DES. */
extern char *crypt (__const char *__key, __const char *__salt) __THROW;
extern char *crypt (__const char *__key, __const char *__salt)
__THROW __nonnull ((1, 2));
/* Encrypt data in BLOCK in place if EDFLAG is zero; otherwise decrypt
block in place. */
extern void encrypt (char *__block, int __edflag) __THROW;
extern void encrypt (char *__block, int __edflag) __THROW __nonnull ((1));
/* Swab pairs bytes in the first N bytes of the area pointed to by
@ -1008,7 +1025,7 @@ extern void encrypt (char *__block, int __edflag) __THROW;
range [FROM - N + 1, FROM - 1]. If N is odd the first byte in FROM
is without partner. */
extern void swab (__const void *__restrict __from, void *__restrict __to,
ssize_t __n) __THROW;
ssize_t __n) __THROW __nonnull ((1, 2));
#endif
@ -1016,7 +1033,7 @@ extern void swab (__const void *__restrict __from, void *__restrict __to,
It is also found in <stdio.h>. */
#ifdef __USE_XOPEN
/* Return the name of the controlling terminal. */
extern char *ctermid (char *__s) __THROW;
extern char *ctermid (char *__s) __THROW __nonnull ((1));
#endif
__END_DECLS