Skip to contentSkip to conversation

Unexpected syscalls on 64-bit arches

DISCUSSION Jakub Jelinek 3 participants 3 messages Apr 16, 2004 Generic include/asm header files

lore
Share & tools
lore
#0 lore raw

Hi!

While updating our glibc-kernheaders asm*/unistd.h tables, I have noticed a bunch of syscalls which IMHO should have never been added:

asm-ia64/unistd.h:
#define __NR_fstatfs64 1257
#define __NR_statfs64 1258
asm-ppc64/unistd.h:

#define __NR_statfs64           252
#define __NR_fstatfs64          253
#define __NR_fadvise64_64       254

asm-s390/unistd.h:
#define __NR_statfs64 265
#define __NR_fstatfs64 266
but doesn't have
#undef __NR_statfs64
and
#undef __NR_fstatfs64
in the __s390x__ section
asm-sparc64/unistd.h:

#define __NR_statfs64           234 /* Linux Specific                              */
#define __NR_fstatfs64          235 /* Linux Specific                              */
#define __NR_fadvise64_64       210 /* Linux Specific                              */

On all these arches, struct statfs and struct statfs64 are identical, thus __NR_statfs64 is a dup of __NR_statfs and __NR_fstatfs64 is a dup of __NR_fstatfs.
Similarly, __NR_fadvise64_64 is a dup of __NR_fadvise64_64.

At least from glibc's point of view, these syscalls will never be used on 64-bit arches, so IMHO they should be at least killed from the unistd.h headers to avoid confusion and maybe nuked from the syscall tables as well.

Jakub

#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Jakub Jelinek

Jakub> On all these arches, struct statfs and struct statfs64 are Jakub> identical,

Yes.

Jakub> thus __NR_statfs64 is a dup of __NR_statfs and Jakub> __NR_fstatfs64 is a dup of __NR_fstatfs.

But sys_{f,}statfs64() does take an additional "size" argument. Perhaps the intention was to enable extensibility?

	--david
#2 lore raw
In reply to Jakub Jelinek
Quoted 4 lines · On Fri, 16 Apr 2004 17:08:03 -0400 Jakub Jelinek <[email protected]> wrote:

At least from glibc's point of view, these syscalls will never be used on 64-bit arches, so IMHO they should be at least killed from the unistd.h headers to avoid confusion and maybe nuked from the syscall tables as well.

I agree perhaps about unistd.h removal, but there is danger that some binary might invoke it so better not remove it from the syscall tables.