@comment unistd.h
@comment BSD
-@deftypefun {char *} getwd (char *@var{buffer})
+@deftypefn {Deprecated Function} {char *} getwd (char *@var{buffer})
This is similar to @code{getcwd}, but has no way to specify the size of
the buffer. The GNU library provides @code{getwd} only
for backwards compatibility with BSD.
system there is no limit to the size of a file name, so this is not
necessarily enough space to contain the directory name. That is why
this function is deprecated.
+@end deftypefn
+
+@comment unistd.h
+@comment GNU
+@deftypefun {char *} get_current_dir_name (void)
+@vindex PWD
+This @code{get_current_dir_name} function is bascially equivalent to
+@w{@code{getcwd (NULL, 0)}}. The only difference is that the value of
+the @code{PWD} variable is returned if this value is correct. This is a
+subtle difference which is visible if the path described by the
+@code{PWD} value is using one or more symbol links in which case the
+value returned by @code{getcwd} can resolve the symbol links and
+therefore yield a different result.
+
+This function is a GNU extension.
@end deftypefun
@comment unistd.h
This structure may contain additional members in the future. Their
availability is always announced in the compilation environment by a
-macro names @code{_DIRENT_HAVE_D_xxx} where @code{xxx} is replaced by
-the name of the new member. For instance, the member @code{d_reclen}
+macro names @code{_DIRENT_HAVE_D_@var{xxx}} where @var{xxx} is replaced
+by the name of the new member. For instance, the member @code{d_reclen}
available on some systems is announced through the macro
@code{_DIRENT_HAVE_D_RECLEN}.
sysconf (_SC_PHYS_PAGES)
@end smallexample
-@noindent returns the total number of page of physical the system has.
+@noindent
+returns the total number of pages of physical the system has.
This does not mean all this memory is available. This information can
be found using
If all applications together constantly use more than that amount of
memory the system is in trouble.
+The GNU C library provides in addition to these already described way to
+get this information two functions. They are declared in the file
+@file{sys/sysinfo.h}. Programmers should prefer to use the
+@code{sysconf} method described above.
+
+@comment sys/sysinfo.h
+@comment GNU
+@deftypefun long int get_phys_pages (void)
+The @code{get_phys_pages} function returns the total number of pages of
+physical the system has. To get the amount of memory this number has to
+be multiplied by the page size.
+
+This function is a GNU extension.
+@end deftypefun
+
+@comment sys/sysinfo.h
+@comment GNU
+@deftypefun long int get_avphys_pages (void)
+The @code{get_phys_pages} function returns the number of available pages of
+physical the system has. To get the amount of memory this number has to
+be multiplied by the page size.
+
+This function is a GNU extension.
+@end deftypefun
+
@node Processor Resources
@section Learn about the processors available
returns the number of processors which are currently inline (i.e.,
available).
+For these two pieces of information the GNU C library also provides
+functions to get the information directly. The functions are declared
+in @file{sys/sysinfo.h}.
+
+@comment sys/sysinfo.h
+@comment GNU
+@deftypefun int get_nprocs_conf (void)
+The @code{get_nprocs_conf} function returns the number of processors the
+operating system configured.
+
+This function is a GNU extension.
+@end deftypefun
+
+@comment sys/sysinfo.h
+@comment GNU
+@deftypefun int get_nprocs (void)
+The @code{get_nprocs} function returns the number of available processors.
+
+This function is a GNU extension.
+@end deftypefun
+
@cindex load average
Before starting more threads it should be checked whether the processors
are not already overused. Unix systems calculate something called the