summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2004-11-25David MacKenzie's old code was removed, so givePaul Eggert
credit only to Jim Meyering and adjust the copyright dates. Do not include <limits.h>, <stdio.h>, <sys/types.h>, <stdlib.h>, <unistd.h>, "pathmax.h". Instead, include "xgetcwd.h" (first) and "getcwd.h". (INITIAL_BUFFER_SIZE): Remove. (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
2004-11-25Replace by a copy of glibc/sysdeps/posix/getcwd.c, butPaul Eggert
with the following changes. (__set_errno): Parenthesize properly. Include <stdbool.h>. (MIN, MAX, MATCHING_INO): New macros. (__getcwd): Define with prototype, not K&R form. Use heuristics to allocate default buffer on stack if possible. If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2) behavior, and to avoid the PATH_MAX limit when computing ../../../../... Use MATCHING_INO to compare inode number to file. Check for arithmetic overflow in size calculations. Fix bug in reallocation of dot array that caused getcwd to fail on directories nested deeper than 75. Be more careful about saving errno on error. Do not use realloc; use only free+malloc, as this is a bit more flexible and avoids a needless copy operation. Do not inspect st_dev and st_ino for symbolic links; POSIX doesn't specify the latter. Check for closedir errors. Avoid needless casts. Use "#ifdef weak_alias" around weak_alias, to be like other glibc code. The following changes to getcwd.c have effect only when used in gnulib; they have no effect inside glibc proper. (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove, as alloca isn't used. (alloca, __alloca): Likewise. [!_LIBC]: Include "getcwd.h", "mempcpy.h". Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h> unconditionally, as gnulib assumes C89 or better. Do not include <sys/param.h>. (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or better. (NULL) [!defined NULL]: Remove; we assume C89 or better. Include <dirent.h> in a way that is compatible with modern Autoconf. (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN): New macros, if not already defined. Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__. Use "_LIBC", not "defined _LIBC", for consistency. (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has a mempcpy module. (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros. (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
2004-11-25(libfetish_a_SOURCES): Add getcwd.h, mempcpy.h.Paul Eggert
2004-11-25Initial revision.Paul Eggert
2004-11-25Imported from gnulib.Paul Eggert
2004-11-23remove trailing blanksJim Meyering
2004-11-23Sync from gnulib.Paul Eggert
2004-11-23utimens upgrade to support futimes.Paul Eggert
2004-11-23(__attribute__, ATTRIBUTE_UNUSED): New macros.Paul Eggert
(futimens): New function, which uses futimes if available. (futimens, utimens): Support timespec==NULL, with same semantics as utime and utimens.
2004-11-23(futimens): New decl.Paul Eggert
2004-11-23add a commentJim Meyering
2004-11-23*** empty log message ***Jim Meyering
2004-11-23Revert last change, since it seems EBADF is always defined.Jim Meyering
2004-11-22*** empty log message ***Jim Meyering
2004-11-22(EBADF): Fail with `#error ...' if it's not defined,Jim Meyering
asking the user to report the problem.
2004-11-17Sync from gnulib.Paul Eggert
2004-11-17* xgetcwd.c: Work around Solaris 9 bug.Paul Eggert
2004-11-17Include <limits.h>, for PATH_MAX.Paul Eggert
(xgetcwd): Set errno correctly when failing. Work around Solaris 9 bug: getcwd sets errno==ERANGE even though the failure is actually due to a PATH_MAX problem.
2004-11-17Merge from gnulib.Paul Eggert
2004-11-17Recent checkins for getopt, canon-host.Paul Eggert
2004-11-17(_getopt_internal, _getopt_internal_r,Paul Eggert
_getopt_long_r, _getopt_long_only_r): argv is char **, not char *__getopt_argv_const *.
2004-11-17(getopt_long, _getopt_long_r, getopt_long_only,Paul Eggert
_getopt_long_only_r): Argv is now char**, not char *__getopt_argv_const*.
2004-11-17(getopt_long, _getopt_long_r, getopt_long_only,Paul Eggert
_getopt_long_only_r): Argv is now char **, not char *__getopt_argv_const*.
2004-11-17(_getopt_initialize, _getopt_internal_r, _getopt_internal):Paul Eggert
New arg POSIXLY_CORRECT. All callers changed. (getopt): Argv is now char * const *, as per standard. (_getopt_internal_r, _getopt_internal): Argv is now char **, not char *__getopt_argv_const *.
2004-11-16Include "strdup.h".Paul Eggert
(canon_host): Use getaddrinfo if available, so that IPv6 works. Use strdup instead of malloc/strcpy to duplicate strings.
2004-11-16* getdate.y (tORDINAL): New token.Paul Eggert
2004-11-16(tORDINAL): New token.Paul Eggert
(day, relunit): Allow it for relative times. (relative_time_table): Use tORDINAL for ordinals.
2004-11-16Support for human_space_before_unit.Paul Eggert
2004-11-16(human_readable): Support human_space_before_unit.Paul Eggert
2004-11-16(LONGEST_HUMAN_READABLE): Add 1 for space before unit.Paul Eggert
(human_space_before_unit): New constant.
2004-11-14*** empty log message ***Jim Meyering
2004-11-14.Jim Meyering
2004-11-14(close_stdout): Don't fail just because stdout wasJim Meyering
closed initially, since some programs don't write to stdout in the normal course of operation (other than --version and --help), and we don't want this function to make e.g. `cp 1 2 >&-' fail. But do fail if it was closed and someone has tried to write to it. E.g., printf 'foo' >&-
2004-11-14(libfetish_a_SOURCES): Add __fpending.h.Jim Meyering
2004-11-14Restore these files. They're useful after all.Jim Meyering
2004-11-12Sync from gnulib and regenerate.Paul Eggert
2004-11-11remove trailing blanksJim Meyering
2004-11-11Sync from gnulib.Paul Eggert
2004-11-11Sync from gnulib.Paul Eggert
2004-11-09Sync from gnulib.Paul Eggert
2004-11-06.Jim Meyering
2004-11-06remove now-unused filesJim Meyering
2004-11-06.Jim Meyering
2004-11-06(libfetish_a_SOURCES): Remove __fpending.h, now that it's no longer used.Jim Meyering
2004-11-06*** empty log message ***Jim Meyering
2004-11-06Ensure that no close failure goes unreported.Jim Meyering
(close_stdout): Always close stdout. I.e., don't return early when it seems there's nothing to flush. Don't include __fpending.h.
2004-11-04Regenerate.Paul Eggert
2004-11-03remove trailing spacesJim Meyering
2004-11-03Log recent getdate-etc. related changes.Paul Eggert
2004-11-03Sync from gnulib.Paul Eggert