bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Subject: add dependencies to 'stat'
Date: Sun, 22 Mar 2020 13:40:33 +0100	[thread overview]
Message-ID: <2419631.XzKDRq9MxM@omega> (raw)
In-Reply-To: <4788282.ZROCF8QrpU@omega>

On 2020-03-08 I wrote:
> We have documented on 2020-01-03 that fstat() needs workarounds even on plain
> glibc/Linux systems. So, basically every use of fstat() in gnulib needs a
> dependency on the 'fstat' module.

Likewise for the 'stat' module. I found these (listing the source files and
corresponding modules):

linkat, renameatu
at-func2.c:128:      if (stat (".", &st1) == -1 || fstat (fd2, &st2) == -1)
at-func2.c:140:      if (stat (".", &st2) == -1 || fstat (fd1, &st1) == -1)
at-func2.c:162:          if (stat (".", &st1) == 0 && SAME_INODE (st1, st2))
at-func2.c:175:      if (stat (".", &st2) == 0 && SAME_INODE (st1, st2))

linkat
linkat.c:72:      if (lstat (file1, &st1) == 0 && stat (dir, &st2) == 0)

canonicalize
canonicalize.c:233:          else if ((logical ? stat (rname, &st) : lstat (rname, &st)) != 0)

file-has-acl (Not needed on Linux. But on HP-UX 32-bit, off_t is 32-bit.)
file-has-acl.c:356:              if (stat (name, &statbuf) < 0)

fstatat
fstatat.c:116:  return stat (name, st);

fstat
fstat.c:75:    return stat (name, buf);

glob
glob.c:79:# define __stat64(fname, buf)   stat (fname, buf)
glob.c:262:          : __stat64 (filename, &st64) == 0 && S_ISDIR (st64.st_mode));

javacomp
javacomp.c:840:          && stat (compiled_file_name, &statbuf) >= 0
javacomp.c:855:              && stat (compiled_file_name, &statbuf) >= 0
javacomp.c:889:                      && stat (compiled_file_name, &statbuf) >= 0)
javacomp.c:923:              && stat (compiled_file_name, &statbuf) >= 0
javacomp.c:988:          && stat (compiled_file_name, &statbuf) >= 0)
javacomp.c:1050:          && stat (compiled_file_name, &statbuf) >= 0)
javacomp.c:1064:          && stat (compiled_file_name, &statbuf) >= 0)
javacomp.c:1096:              && stat (compiled_file_name, &statbuf) >= 0)
javacomp.c:1105:                    && stat (compiled_file_name, &statbuf) >= 0))
javacomp.c:1191:          && stat (compiled_file_name, &statbuf) >= 0
javacomp.c:1206:              && stat (compiled_file_name, &statbuf) >= 0
javacomp.c:1240:                      && stat (compiled_file_name, &statbuf) >= 0)
javacomp.c:1274:              && stat (compiled_file_name, &statbuf) >= 0
javacomp.c:1290:                  && stat (compiled_file_name, &statbuf) >= 0
javacomp.c:1326:                          && stat (compiled_file_name, &statbuf) >= 0)
javacomp.c:1364:                  && stat (compiled_file_name, &statbuf) >= 0
javacomp.c:1630:          && stat (compiled_file_name, &statbuf) >= 0
javacomp.c:1642:              && stat (compiled_file_name, &statbuf) >= 0
javacomp.c:1675:                      && stat (compiled_file_name, &statbuf) >= 0)
javacomp.c:1706:              && stat (compiled_file_name, &statbuf) >= 0
javacomp.c:1769:          && stat (compiled_file_name, &statbuf) >= 0)
javacomp.c:1826:          && stat (compiled_file_name, &statbuf) >= 0)
javacomp.c:1840:              && stat (compiled_file_name, &statbuf) >= 0)
javacomp.c:1938:          && stat (compiled_file_name, &statbuf) >= 0
javacomp.c:1951:              && stat (compiled_file_name, &statbuf) >= 0
javacomp.c:1985:                      && stat (compiled_file_name, &statbuf) >= 0)
javacomp.c:2017:              && stat (compiled_file_name, &statbuf) >= 0
javacomp.c:2032:                  && stat (compiled_file_name, &statbuf) >= 0
javacomp.c:2067:                          && stat (compiled_file_name, &statbuf) >= 0)
javacomp.c:2102:                  && stat (compiled_file_name, &statbuf) >= 0

mkdir
mkdir.c:80:        if (stat (tmp_dir, &st) == 0)

pt_chown
pt_chown.c:53:  if (stat (pty, &st) < 0 || !S_ISCHR (st.st_mode))

ptsname_r
ptsname_r.c:201:  if (__stat (buf, &st) < 0)

readlinkat
readlinkat.c:46:      if (stat (file, &st) == 0)

rename
rename.c:91:  if (stat (src, &src_st))
rename.c:93:  if (stat (dst, &dst_st))

acl-permissions
set-permissions.c:286:    ret = stat (name, &statbuf);

tmpdir
tmpdir.c:57:# define __xstat64(version, path, buf) stat (path, buf)

utimens
utimens.c:236:          if (fd < 0 ? stat (file, &st) : fstat (fd, &st))
utimens.c:380:          && (fd < 0 ? stat (file, &st) : fstat (fd, &st)))

relocatable-prog-wrapper
progreloc.c:177:          if (stat (filename, &statfile) < 0)


2020-03-22  Bruno Haible  <bruno@clisp.org>

	Several modules: Depend on stat.
	* modules/acl-permissions (Depends-on): Add stat.
	* modules/canonicalize (Depends-on): Likewise.
	* modules/file-has-acl (Depends-on): Likewise.
	* modules/fstat (Depends-on): Likewise.
	* modules/fstatat (Depends-on): Likewise.
	* modules/glob (Depends-on): Likewise.
	* modules/javacomp (Depends-on): Likewise.
	* modules/linkat (Depends-on): Likewise.
	* modules/mkdir (Depends-on): Likewise.
	* modules/pt_chown (Depends-on): Likewise.
	* modules/ptsname_r (Depends-on): Likewise.
	* modules/readlinkat (Depends-on): Likewise.
	* modules/rename (Depends-on): Likewise.
	* modules/renameatu (Depends-on): Likewise.
	* modules/tmpdir (Depends-on): Likewise.
	* modules/utimens (Depends-on): Likewise.
	* modules/relocatable-prog-wrapper (Depends-on): Add largefile.
	* modules/same (Depends-on): Remove stat.

diff --git a/modules/acl-permissions b/modules/acl-permissions
index 49b91ff..3ecbb95 100644
--- a/modules/acl-permissions
+++ b/modules/acl-permissions
@@ -14,6 +14,7 @@ m4/acl.m4
 Depends-on:
 extern-inline
 fstat
+stat
 stdbool
 sys_stat
 
diff --git a/modules/canonicalize b/modules/canonicalize
index bf3dc57..b8aadb7 100644
--- a/modules/canonicalize
+++ b/modules/canonicalize
@@ -17,6 +17,7 @@ lstat
 memmove
 nocrash
 pathmax
+stat
 sys_stat
 xalloc
 xgetcwd
diff --git a/modules/file-has-acl b/modules/file-has-acl
index 4857fea..0f8ab37 100644
--- a/modules/file-has-acl
+++ b/modules/file-has-acl
@@ -8,6 +8,7 @@ m4/acl.m4
 
 Depends-on:
 acl-permissions
+stat
 
 configure.ac:
 gl_FILE_HAS_ACL
diff --git a/modules/fstat b/modules/fstat
index b557494..e88bb43 100644
--- a/modules/fstat
+++ b/modules/fstat
@@ -11,6 +11,7 @@ Depends-on:
 sys_stat
 largefile
 pathmax         [test $REPLACE_FSTAT = 1]
+stat            [test $REPLACE_FSTAT = 1]
 stat-time       [test $REPLACE_FSTAT = 1]
 unistd          [test $REPLACE_FSTAT = 1]
 verify          [test $REPLACE_FSTAT = 1]
diff --git a/modules/fstatat b/modules/fstatat
index c311846..14c3f27 100644
--- a/modules/fstatat
+++ b/modules/fstatat
@@ -20,6 +20,7 @@ lstat           [test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1]
 openat-die      [test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1]
 openat-h        [test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1]
 save-cwd        [test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1]
+stat            [test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1]
 stat-time       [test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1]
 
 configure.ac:
diff --git a/modules/glob b/modules/glob
index 33d43bf..eb1bd9e 100644
--- a/modules/glob
+++ b/modules/glob
@@ -26,6 +26,7 @@ mempcpy         [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
 opendir         [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
 readdir         [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
 scratch_buffer  [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
+stat            [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
 stdbool         [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
 stdint          [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
 strdup          [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
diff --git a/modules/javacomp b/modules/javacomp
index d1cc559..4f49bd9 100644
--- a/modules/javacomp
+++ b/modules/javacomp
@@ -23,6 +23,7 @@ getline
 xconcat-filename
 fwriteerror
 clean-temp
+stat
 error
 xvasprintf
 c-strstr
diff --git a/modules/linkat b/modules/linkat
index e0c4165..a7cbb94 100644
--- a/modules/linkat
+++ b/modules/linkat
@@ -25,6 +25,7 @@ link             [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
 lstat            [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
 same-inode       [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
 save-cwd         [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
+stat             [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
 symlink          [test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1]
 areadlinkat      [test $REPLACE_LINKAT = 1]
 fstatat          [test $REPLACE_LINKAT = 1]
diff --git a/modules/mkdir b/modules/mkdir
index 032f1c5..2f1850c 100644
--- a/modules/mkdir
+++ b/modules/mkdir
@@ -8,6 +8,7 @@ m4/mkdir.m4
 Depends-on:
 sys_stat
 dirname-lgpl    [test $REPLACE_MKDIR = 1]
+stat            [test $REPLACE_MKDIR = 1]
 
 configure.ac:
 gl_FUNC_MKDIR
diff --git a/modules/pt_chown b/modules/pt_chown
index ddde845..5cf4a7c 100644
--- a/modules/pt_chown
+++ b/modules/pt_chown
@@ -10,6 +10,7 @@ ptsname
 root-uid
 stdlib
 configmake
+stat
 
 configure.ac:
 
diff --git a/modules/ptsname_r b/modules/ptsname_r
index 9adc08b..9cd5703 100644
--- a/modules/ptsname_r
+++ b/modules/ptsname_r
@@ -9,6 +9,7 @@ Depends-on:
 stdlib
 extensions
 isatty          [test $HAVE_PTSNAME_R = 0 || test $REPLACE_PTSNAME_R = 1]
+stat            [test $HAVE_PTSNAME_R = 0 || test $REPLACE_PTSNAME_R = 1]
 ttyname_r       [test $HAVE_PTSNAME_R = 0 || test $REPLACE_PTSNAME_R = 1]
 
 configure.ac:
diff --git a/modules/readlinkat b/modules/readlinkat
index a89c53f..84dac40 100644
--- a/modules/readlinkat
+++ b/modules/readlinkat
@@ -17,6 +17,7 @@ fcntl-h         [test $HAVE_READLINKAT = 0]
 openat-die      [test $HAVE_READLINKAT = 0]
 openat-h        [test $HAVE_READLINKAT = 0]
 save-cwd        [test $HAVE_READLINKAT = 0]
+stat            [test $HAVE_READLINKAT = 0]
 readlink        [test $HAVE_READLINKAT = 0]
 
 configure.ac:
diff --git a/modules/relocatable-prog-wrapper b/modules/relocatable-prog-wrapper
index 58af208..25cc66f 100644
--- a/modules/relocatable-prog-wrapper
+++ b/modules/relocatable-prog-wrapper
@@ -37,6 +37,7 @@ Depends-on:
 alloca-opt
 double-slash-root
 errno
+largefile
 pathmax
 ssize_t
 stdbool
diff --git a/modules/rename b/modules/rename
index 582d630..27d6d4a 100644
--- a/modules/rename
+++ b/modules/rename
@@ -13,6 +13,7 @@ dirname-lgpl      [test $REPLACE_RENAME = 1]
 lstat             [test $REPLACE_RENAME = 1]
 rmdir             [test $REPLACE_RENAME = 1]
 same-inode        [test $REPLACE_RENAME = 1]
+stat              [test $REPLACE_RENAME = 1]
 stdbool           [test $REPLACE_RENAME = 1]
 strdup            [test $REPLACE_RENAME = 1]
 
diff --git a/modules/renameatu b/modules/renameatu
index bc320d1..d0a123c 100644
--- a/modules/renameatu
+++ b/modules/renameatu
@@ -23,6 +23,7 @@ openat-die       [test $HAVE_RENAMEAT = 0]
 rename           [test $HAVE_RENAMEAT = 0]
 same-inode       [test $HAVE_RENAMEAT = 0]
 save-cwd         [test $HAVE_RENAMEAT = 0]
+stat             [test $HAVE_RENAMEAT = 0]
 
 configure.ac:
 gl_FUNC_RENAMEAT
diff --git a/modules/same b/modules/same
index 24c9cf3..f4926be 100644
--- a/modules/same
+++ b/modules/same
@@ -14,7 +14,6 @@ fstat
 fstatat
 openat
 same-inode
-stat
 stdbool
 memcmp
 
diff --git a/modules/tmpdir b/modules/tmpdir
index 40023b8..591a741 100644
--- a/modules/tmpdir
+++ b/modules/tmpdir
@@ -8,6 +8,7 @@ m4/tmpdir.m4
 
 Depends-on:
 secure_getenv
+stat
 stdbool
 sys_stat
 pathmax
diff --git a/modules/utimens b/modules/utimens
index dbe24df..c124cb5 100644
--- a/modules/utimens
+++ b/modules/utimens
@@ -15,6 +15,7 @@ fstat
 lstat
 gettime
 msvc-nothrow
+stat
 stat-time
 stdbool
 sys_stat



      reply	other threads:[~2020-03-22 12:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-08 23:56 add dependencies to 'fstat' Bruno Haible
2020-03-22 12:40 ` Bruno Haible [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2419631.XzKDRq9MxM@omega \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).