Source: purelibc
Version: 1.0.8-1
Severity: important
X-Debbugs-Cc: [email protected]

Dear Maintainer,

* What led up to the situation?
  an update of the glibc
* What exactly did you do (or not do) that was effective (or ineffective)?
  system calls stat/fstat/lstat cannot be virtualized
* an updated package is needed for trixie

the following code pt.c works on purelibc 1.0.9, it fails in 1.0.8
compile it:
gcc -o pt pt.c -l purelibc
----
#define _GNU_SOURCE
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <sys/syscall.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdlib.h>
#include <purelibc.h>

static sfun _native_syscall;

static char buf[128];
static long int mysc(long int sysno, ...){
        va_list ap;
        long int a1,a2,a3,a4,a5,a6;
        va_start (ap, sysno);
        snprintf(buf,128,"SC=%d\n",sysno);
        _native_syscall(__NR_write,2,buf,strlen(buf));
        a1=va_arg(ap,long int);
        a2=va_arg(ap,long int);
        a3=va_arg(ap,long int);
        a4=va_arg(ap,long int);
        a5=va_arg(ap,long int);
        a6=va_arg(ap,long int);
        va_end(ap);
        return _native_syscall(sysno,a1,a2,a3,a4,a5,a6);
}

int main() {
        int c;
        _native_syscall=_pure_start(mysc,PUREFLAG_STDALL);
        struct stat buf;
        stat("/", &buf);
        lstat("/", &buf);
        return 0;
}
------

-- System Information:
Debian Release: trixie

Reply via email to