Make linux386 work with the new libc layout.
This commit is contained in:
parent
32c881474e
commit
66815ff987
|
@ -7,7 +7,7 @@ vars.ackcflags = {
|
||||||
vars.ackldflags = {}
|
vars.ackldflags = {}
|
||||||
vars.plats = {
|
vars.plats = {
|
||||||
"cpm",
|
"cpm",
|
||||||
-- "linux386",
|
"linux386",
|
||||||
-- "linux68k",
|
-- "linux68k",
|
||||||
-- "linuxppc",
|
-- "linuxppc",
|
||||||
-- "osx386",
|
-- "osx386",
|
||||||
|
@ -20,7 +20,7 @@ vars.plats = {
|
||||||
}
|
}
|
||||||
vars.plats_with_tests = {
|
vars.plats_with_tests = {
|
||||||
-- "linux68k",
|
-- "linux68k",
|
||||||
-- "linux386",
|
"linux386",
|
||||||
-- "linuxppc",
|
-- "linuxppc",
|
||||||
-- --"qemuppc",
|
-- --"qemuppc",
|
||||||
-- "pc86",
|
-- "pc86",
|
||||||
|
|
|
@ -7,10 +7,9 @@
|
||||||
#define _TIME_H
|
#define _TIME_H
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
#define CLOCKS_PER_SEC 1000000
|
#define CLOCKS_PER_SEC 1000000
|
||||||
|
|
||||||
typedef unsigned long time_t; /* type returned by TOD clock */
|
|
||||||
typedef unsigned long clock_t; /* type returned by real time clock */
|
typedef unsigned long clock_t; /* type returned by real time clock */
|
||||||
|
|
||||||
struct tm {
|
struct tm {
|
||||||
|
@ -25,7 +24,9 @@ struct tm {
|
||||||
int tm_isdst; /* Daylight Saving Time flag */
|
int tm_isdst; /* Daylight Saving Time flag */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Not a system call; this calls gettimeofday() or times() to do the work */
|
||||||
extern clock_t clock(void);
|
extern clock_t clock(void);
|
||||||
|
|
||||||
extern double difftime(time_t _time1, time_t _time0);
|
extern double difftime(time_t _time1, time_t _time0);
|
||||||
extern time_t mktime(struct tm *_timeptr);
|
extern time_t mktime(struct tm *_timeptr);
|
||||||
extern time_t time(time_t *_timeptr);
|
extern time_t time(time_t *_timeptr);
|
||||||
|
|
|
@ -13,44 +13,61 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#if ACKCONF_WANT_STANDARD_O
|
#if ACKCONF_WANT_STANDARD_O
|
||||||
/* A standard set of flags for read/write/creat and friends for platforms
|
/* A standard set of flags for read/write/creat and friends for platforms
|
||||||
* where these aren't determined by the operating system. */
|
* where these aren't determined by the operating system. */
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
O_ACCMODE = 0x3,
|
O_ACCMODE = 0x3,
|
||||||
|
|
||||||
O_RDONLY = 0,
|
O_RDONLY = 0,
|
||||||
O_WRONLY = 1,
|
O_WRONLY = 1,
|
||||||
O_RDWR = 2,
|
O_RDWR = 2,
|
||||||
|
|
||||||
O_CREAT = 0100,
|
O_CREAT = 0100,
|
||||||
O_TRUNC = 01000,
|
O_TRUNC = 01000,
|
||||||
O_APPEND = 02000,
|
O_APPEND = 02000,
|
||||||
O_NONBLOCK = 04000
|
O_NONBLOCK = 04000
|
||||||
};
|
};
|
||||||
|
#else
|
||||||
|
#include <ack/fcntl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ACKCONF_WANT_STANDARD_SIGNALS
|
#if ACKCONF_WANT_STANDARD_SIGNALS
|
||||||
/* A standard set of definitions for signal handling for platforms where these
|
/* A standard set of definitions for signal handling for platforms where these
|
||||||
* aren't determined by the operating system. */
|
* aren't determined by the operating system. */
|
||||||
|
|
||||||
typedef int sig_atomic_t;
|
typedef int sig_atomic_t;
|
||||||
|
|
||||||
#define SIG_ERR ((sighandler_t) -1) /* Error return. */
|
#define SIG_ERR ((sighandler_t) -1) /* Error return. */
|
||||||
#define SIG_DFL ((sighandler_t) 0) /* Default action. */
|
#define SIG_DFL ((sighandler_t) 0) /* Default action. */
|
||||||
#define SIG_IGN ((sighandler_t) 1) /* Ignore signal. */
|
#define SIG_IGN ((sighandler_t) 1) /* Ignore signal. */
|
||||||
|
|
||||||
#define SIGABRT 6 /* Abort (ANSI) */
|
#define SIGABRT 6 /* Abort (ANSI) */
|
||||||
#define SIGILL 11 /* Illegal instruction */
|
#define SIGILL 11 /* Illegal instruction */
|
||||||
|
|
||||||
#define _NSIG 16 /* Biggest signal number + 1
|
|
||||||
(not including real-time signals). */
|
|
||||||
typedef void (*sighandler_t)(int);
|
|
||||||
typedef uint16_t sigset_t;
|
|
||||||
|
|
||||||
|
#define _NSIG 16 /* Biggest signal number + 1
|
||||||
|
(not including real-time signals). */
|
||||||
|
typedef void (*sighandler_t)(int);
|
||||||
|
typedef uint16_t sigset_t;
|
||||||
|
#else
|
||||||
|
#include <ack/signal.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Time handling. */
|
||||||
|
|
||||||
|
struct timeval
|
||||||
|
{
|
||||||
|
time_t tv_sec;
|
||||||
|
suseconds_t tv_usec;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct timezone
|
||||||
|
{
|
||||||
|
int tz_minuteswest;
|
||||||
|
int tz_dsttime;
|
||||||
|
}; /* obsolete, unused */
|
||||||
|
|
||||||
/* Special variables */
|
/* Special variables */
|
||||||
|
|
||||||
extern char** environ;
|
extern char** environ;
|
||||||
|
@ -61,11 +78,14 @@ extern int brk(void* ptr);
|
||||||
extern int close(int d);
|
extern int close(int d);
|
||||||
extern int creat(const char* path, mode_t mode);
|
extern int creat(const char* path, mode_t mode);
|
||||||
extern int execve(const char *path, char *const argv[], char *const envp[]);
|
extern int execve(const char *path, char *const argv[], char *const envp[]);
|
||||||
|
extern int fcntl(int fd, int op, ...);
|
||||||
|
extern int gettimeofday(struct timeval* tv, struct timezone* tz);
|
||||||
extern int isatty(int d);
|
extern int isatty(int d);
|
||||||
extern int isatty(int d);
|
extern int isatty(int d);
|
||||||
extern int kill(pid_t old, int sig);
|
extern int kill(pid_t old, int sig);
|
||||||
extern int open(const char* path, int access, ...);
|
extern int open(const char* path, int access, ...);
|
||||||
extern int raise(int signum);
|
extern int raise(int signum);
|
||||||
|
extern int settimeofday(const struct timeval* tv, const struct timezone* tz);
|
||||||
extern int sigprocmask(int, const sigset_t *, sigset_t *);
|
extern int sigprocmask(int, const sigset_t *, sigset_t *);
|
||||||
extern int unlink(const char* path);
|
extern int unlink(const char* path);
|
||||||
extern off_t lseek(int fildes, off_t offset, int whence);
|
extern off_t lseek(int fildes, off_t offset, int whence);
|
||||||
|
@ -75,6 +95,6 @@ extern ssize_t read(int fd, void* buffer, size_t count);
|
||||||
extern ssize_t write(int fd, void* buffer, size_t count);
|
extern ssize_t write(int fd, void* buffer, size_t count);
|
||||||
extern void _exit(int);
|
extern void _exit(int);
|
||||||
extern void* sbrk(int increment);
|
extern void* sbrk(int increment);
|
||||||
extern int fcntl(int fd, int op, ...);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -3,5 +3,7 @@
|
||||||
|
|
||||||
typedef int pid_t;
|
typedef int pid_t;
|
||||||
typedef int mode_t;
|
typedef int mode_t;
|
||||||
|
typedef long time_t;
|
||||||
|
typedef long suseconds_t;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -7,5 +7,5 @@
|
||||||
*/
|
*/
|
||||||
int ioctl(int fd, unsigned long request, void *argp)
|
int ioctl(int fd, unsigned long request, void *argp)
|
||||||
{
|
{
|
||||||
return _syscall(__NR_ioctl, fd, request, argp);
|
return _syscall(__NR_ioctl, fd, request, (quad)argp);
|
||||||
}
|
}
|
||||||
|
|
19
plat/linux386/include/ack/fcntl.h
Normal file
19
plat/linux386/include/ack/fcntl.h
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
#ifndef _ACK_FCNTL_H
|
||||||
|
#define _ACK_FCNTL_H
|
||||||
|
|
||||||
|
/* Linux O_ constants. */
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
O_ACCMODE = 0x3,
|
||||||
|
|
||||||
|
O_RDONLY = 0,
|
||||||
|
O_WRONLY = 1,
|
||||||
|
O_RDWR = 2,
|
||||||
|
|
||||||
|
O_CREAT = 0x40,
|
||||||
|
O_TRUNC = 0x200,
|
||||||
|
O_APPEND = 0x400
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -11,4 +11,9 @@
|
||||||
|
|
||||||
/* #define ACKCONF_TIME_IS_A_SYSCALL */
|
/* #define ACKCONF_TIME_IS_A_SYSCALL */
|
||||||
|
|
||||||
|
/* Linux has its own O_ definitions. */
|
||||||
|
|
||||||
|
#define ACKCONF_WANT_STANDARD_O 0
|
||||||
|
#define ACKCONF_WANT_STANDARD_SIGNALS 0
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,76 +1,7 @@
|
||||||
/*
|
#ifndef _ACK_SIGNAL_H
|
||||||
* unistd.h - standard system calls
|
#define _ACK_SIGNAL_H
|
||||||
*/
|
|
||||||
/* $Id$ */
|
|
||||||
|
|
||||||
#ifndef _UNISTD_H
|
/* Signal constants. */
|
||||||
#define _UNISTD_H
|
|
||||||
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <time.h>
|
|
||||||
|
|
||||||
/* Types */
|
|
||||||
|
|
||||||
typedef int pid_t;
|
|
||||||
typedef int mode_t;
|
|
||||||
|
|
||||||
typedef long suseconds_t;
|
|
||||||
|
|
||||||
/* Time handling. */
|
|
||||||
|
|
||||||
struct timeval
|
|
||||||
{
|
|
||||||
time_t tv_sec;
|
|
||||||
suseconds_t tv_usec;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct timezone
|
|
||||||
{
|
|
||||||
int tz_minuteswest;
|
|
||||||
int tz_dsttime;
|
|
||||||
}; /* obsolete, unused */
|
|
||||||
|
|
||||||
extern int gettimeofday(struct timeval* tv, struct timezone* tz);
|
|
||||||
extern int settimeofday(const struct timeval* tv, const struct timezone* tz);
|
|
||||||
|
|
||||||
/* File access. */
|
|
||||||
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
O_ACCMODE = 0x3,
|
|
||||||
|
|
||||||
O_RDONLY = 0,
|
|
||||||
O_WRONLY = 1,
|
|
||||||
O_RDWR = 2,
|
|
||||||
|
|
||||||
O_CREAT = 0x40,
|
|
||||||
O_TRUNC = 0x200,
|
|
||||||
O_APPEND = 0x400
|
|
||||||
};
|
|
||||||
|
|
||||||
extern int open(const char* path, int access, ...);
|
|
||||||
extern int creat(const char* path, mode_t mode);
|
|
||||||
extern int close(int d);
|
|
||||||
extern int read(int fd, void* buffer, size_t count);
|
|
||||||
extern int write(int fd, void* buffer, size_t count);
|
|
||||||
extern off_t lseek(int fildes, off_t offset, int whence);
|
|
||||||
extern int fcntl(int fd, int op, ...);
|
|
||||||
extern int unlink(const char* path);
|
|
||||||
|
|
||||||
/* Special variables */
|
|
||||||
|
|
||||||
extern char** environ;
|
|
||||||
|
|
||||||
/* Implemented system calls */
|
|
||||||
|
|
||||||
extern void _exit(int);
|
|
||||||
extern pid_t getpid(void);
|
|
||||||
extern int brk(void* ptr);
|
|
||||||
extern void* sbrk(int increment);
|
|
||||||
extern int isatty(int d);
|
|
||||||
extern int execve(const char *path, char *const argv[], char *const envp[]);
|
|
||||||
|
|
||||||
/* Signal handling */
|
|
||||||
|
|
||||||
typedef int sig_atomic_t;
|
typedef int sig_atomic_t;
|
||||||
|
|
||||||
|
@ -124,10 +55,5 @@ typedef int sig_atomic_t;
|
||||||
typedef unsigned long sigset_t;
|
typedef unsigned long sigset_t;
|
||||||
|
|
||||||
typedef void (*sighandler_t)(int);
|
typedef void (*sighandler_t)(int);
|
||||||
extern sighandler_t signal(int signum, sighandler_t handler);
|
|
||||||
extern int sigprocmask(int, const sigset_t *, sigset_t *);
|
|
||||||
extern int raise(int signum);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -9,8 +9,10 @@ local function addheader(h)
|
||||||
end
|
end
|
||||||
|
|
||||||
addheader("ack/plat.h")
|
addheader("ack/plat.h")
|
||||||
|
addheader("ack/fcntl.h")
|
||||||
|
addheader("ack/signal.h")
|
||||||
addheader("sys/ioctl.h")
|
addheader("sys/ioctl.h")
|
||||||
addheader("unistd.h")
|
addheader("sys/types.h")
|
||||||
|
|
||||||
acklibrary {
|
acklibrary {
|
||||||
name = "headers",
|
name = "headers",
|
||||||
|
|
9
plat/linux386/include/sys/types.h
Normal file
9
plat/linux386/include/sys/types.h
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#ifndef _SYS_TYPES_H
|
||||||
|
#define _SYS_TYPES_H
|
||||||
|
|
||||||
|
typedef int pid_t;
|
||||||
|
typedef int mode_t;
|
||||||
|
typedef long suseconds_t;
|
||||||
|
typedef long time_t;
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in a new issue