Package: zlibc
Version: 0.9k-4.1

Currently it fails to build thus:

filetype.c: In function 'zlib_initialise':
filetype.c:167:16: error: 'SYS_open' undeclared (first use in this function)
     fd=syscall(SYS_open,"/proc/self/cmdline", O_RDONLY);
                ^
filetype.c:167:16: note: each undeclared identifier is reported only
once for each function it appears in

Find more info at https://buildd.debian.org/status/package.php?p=zlibc&suite=sid

SYS_open is a special case of SYS_openat and is no longer provided for
recent architectures such as aarch64. Here is a patch to use SYS_openat
instead when it is available:

--- zlibc-0.9k.orig/filetype.c
+++ zlibc-0.9k/filetype.c
@@ -164,7 +164,11 @@
     /* get command line */
     cmdline=static_cmdline;
     strcpy(cmdline, "unknown");
+#if defined(SYS_openat) && defined(AT_FDCWD)
+    fd=syscall(SYS_openat, AT_FDCWD, "/proc/self/cmdline", O_RDONLY);
+#else
     fd=syscall(SYS_open,"/proc/self/cmdline", O_RDONLY);
+#endif
     if ( fd > 0 ){
       cmdline[1024]='\0';
       n = read( fd, cmdline,1024 );

It appears to work with that patch.

You could alternatively patch it like this (not tested):

+#ifdef SYS_open
     fd=syscall(SYS_open,"/proc/self/cmdline", O_RDONLY);
+#else
+    fd=syscall(SYS_openat, AT_FDCWD, "/proc/self/cmdline", O_RDONLY);
+#endif


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to