Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Mike <mike@alpha.nmrlab.hscsyr.edu>
To: axp-list@redhat.com, joeyen@alpha.nmrlab.hscsyr.edu
Subject: stat() broken under RH 5.0??
Date: Mon, 1 Jun 1998 11:52:37 -0400	[thread overview]
Message-ID: <199806011552.LAA07657@alpha.nmrlab.hscsyr.edu> (raw)


   We cannot get stat (in a C program, not the shell command) to work
correctly under RedHat 5.0 running on an alpha (kernel 2.0.30).  Any help 
would be appreciated or any work around that returns the file mode for
a given file.

   Here is the code we are using (it works fine under SunOS) and according
to the man pages it should work okay on the alpha as well.  It compiles
okay but segmentation faults.
   gdb gives the following error

   Program received signal SIGSEGV, Segmentation fault.
   __xstat () at ../sysdeps/unix/sysv/linux/xstat.c:52
   ../sysdeps/unix/sysv/linux/xstat.c:52: No such file or directory.


#include <sys/stat.h>
#include <dirent.h>
#include <unistd.h>

main()
{
   struct stat *buf;
   stat("teststat.c",buf);
   printf("%d\n",buf->st_mode);
}

   Thanks Mike


             reply	other threads:[~1998-06-01 20:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-06-01 15:52 Mike [this message]
1998-06-01 21:45 ` stat() broken under RH 5.0?? Quant-X Alpha Linux Support
1998-06-02 13:20   ` Bill Roman
1998-06-02 15:07     ` Michal Jaegermann
     [not found] <Pine.SOL.3.96.980601182010.13382A-100000@tarkovsky.npac.syr.edu>
1998-06-02  0:37 ` Quant-X Alpha Linux Support
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox