stat() command for SCO cross-compiler
Langerholc, Larry
Larry.Langerholc@icn.siemens.com
Thu Jun 17 15:42:00 GMT 1999
We have a problem with "stat() " on our cross-compiler:
larry@boca06: /net/boca04/stp/egcs.1.1.2a/bin/i386-unknown-sco3.2v2.0-c++
statf.cc
statf.cc: In function `int main()':
statf.cc:22: warning: implicit declaration of function `int printf(...)'
statf.cc:23: warning: implicit declaration of function `int sprintf(...)'
statf.cc:25: warning: implicit declaration of function `int open(...)'
statf.cc:31: no matching function for call to `stat::stat (char[100], stat
*)'
stat.h:42: candidates are: stat::stat(const stat &)
/net/boca04/stp/egcs.1.1.2a/i386-unknown-sco3.2v2.0/sys-include/sys/stat.h:4
2: stat::stat()
statf.cc:37: warning: implicit declaration of function `int read(...)'
statf.cc:56: warning: implicit declaration of function `int write(...)'
larry@boca06:
Further investigation shows that the "stat.h" we have doesn't match what's
on
our SCO machine. The main problem seems to be the externs for stat() and
several other functions. So I transferred the header file from SCO to the
directory
/net/boca04/stp/egcs.1.1.2a/i386-unknown-sco3.2v2.0/sys-include/sys/
and swapped it in instead. Then I recompiled and the compile error went
away.
But is this the right thing to do?
Any advice would be appreciated.
Larry Langerholc (561)-997-3789
e-mail: larry.langerholc@icn.siemens.com
=============================================================
Here's the original header file that caused the compile problem:
#ifndef _SYS_STAT_H
#define _SYS_STAT_H
#ident "@(#) stat.h 22.2 90/02/15 "
/*
* UNIX is a registered trademark of AT&T
* Portions Copyright 1976-1989 AT&T
* Portions Copyright 1980-1989 Microsoft Corporation
* Portions Copyright 1983-1990 The Santa Cruz Operation, Inc
* All Rights Reserved
*/
/* Copyright (c) 1984, 1986, 1987, 1988 AT&T */
/* All Rights Reserved */
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
/* The copyright notice above does not evidence any */
/* actual or intended publication of such source code. */
/* Copyright (c) 1987, 1988 Microsoft Corporation */
/* All Rights Reserved */
/* This Module contains Proprietary Information of Microsoft */
/* Corporation and should be treated as Confidential. */
/* #ident "@)#(head.sys:stat.h 1.3.1.2" */
/*
* stat structure, used by stat(2) and fstat(2)
*/
struct stat {
dev_t st_dev;
ushort st_ino;
ushort st_mode;
short st_nlink;
ushort st_uid;
ushort st_gid;
dev_t st_rdev;
off_t st_size;
time_t st_atime;
time_t st_mtime;
time_t st_ctime;
};
#define S_IFMT 0170000 /* type of file */
#define S_IFREG 0100000 /* regular */
#define S_IFBLK 0060000 /* block special */
#define S_IFNAM 0050000 /* special named file */
#define S_IFDIR 0040000 /* directory */
#define S_IFCHR 0020000 /* character special */
#define S_IFIFO 0010000 /* fifo */
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
#define S_ISNAM(m) (((m) & S_IFMT) == S_IFNAM)
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
#define S_INSEM 01 /* XENIX semaphore subtype of IFNAM file */
#define S_INSHD 02 /* XENIX shared data subtype of IFNAM file
*/
#define S_ISUID 04000 /* set user id on execution */
#define S_ISGID 02000 /* set group id on execution */
#define S_ISVTX 01000 /* save swapped text even after use */
#define S_ENFMT S_ISGID /* record locking enforcement flag */
#define S_IRWXU 00700 /* read, write, execute: owner */
#define S_IRUSR 00400 /* read permission: owner */
#define S_IREAD 00400 /* read permission, owner */
#define S_IWUSR 00200 /* write permission: owner */
#define S_IWRITE 00200 /* write permission, owner */
#define S_IXUSR 00100 /* execute permission: owner */
#define S_IEXEC 00100 /* execute/search permission, owner */
#define S_IRWXG 00070 /* read, write, execute: group */
#define S_IRGRP 00040 /* read permission: group */
#define S_IWGRP 00020 /* write permission: group */
#define S_IXGRP 00010 /* execute permission: group */
#define S_IRWXO 00007 /* read, write, execute: other */
#define S_IROTH 00004 /* read permission: other */
#define S_IWOTH 00002 /* write permission: other */
#define S_IXOTH 00001 /* execute permission: other */
#endif /* _SYS_STAT_H */
_______________________________________________
New CrossGCC FAQ: http://www.objsw.com/CrossGCC
_______________________________________________
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.
More information about the crossgcc
mailing list