OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc1/] [newlib/] [libc/] [machine/] [cris/] [sys/] [fcntl.h] - Diff between revs 207 and 345

Only display areas with differences | Details | Blame | View Log

Rev 207 Rev 345
/* This file is to be kept in sync with newlib/libc/include/sys/fcntl.h,
/* This file is to be kept in sync with newlib/libc/include/sys/fcntl.h,
   on which it is based, except values used or returned by syscalls must
   on which it is based, except values used or returned by syscalls must
   be those of the Linux/CRIS kernel.  */
   be those of the Linux/CRIS kernel.  */
 
 
#ifndef _FCNTL_
#ifndef _FCNTL_
#ifdef __cplusplus
#ifdef __cplusplus
extern "C" {
extern "C" {
#endif
#endif
#define _FCNTL_
#define _FCNTL_
#include <_ansi.h>
#include <_ansi.h>
#define _FOPEN          (-1)    /* from sys/file.h, kernel use only */
#define _FOPEN          (-1)    /* from sys/file.h, kernel use only */
#define _FREAD          0x0001  /* read enabled */
#define _FREAD          0x0001  /* read enabled */
#define _FWRITE         0x0002  /* write enabled */
#define _FWRITE         0x0002  /* write enabled */
#define _FNDELAY        0x0800  /* non blocking I/O (4.2 style) */
#define _FNDELAY        0x0800  /* non blocking I/O (4.2 style) */
#define _FAPPEND        0x0400  /* append (writes guaranteed at the end) */
#define _FAPPEND        0x0400  /* append (writes guaranteed at the end) */
#define _FMARK          0x0010  /* internal; mark during gc() */
#define _FMARK          0x0010  /* internal; mark during gc() */
#define _FDEFER         0x0020  /* internal; defer for next gc pass */
#define _FDEFER         0x0020  /* internal; defer for next gc pass */
#define _FASYNC         0x2000  /* signal pgrp when data ready */
#define _FASYNC         0x2000  /* signal pgrp when data ready */
#define _FCREAT         0x0040  /* open with file create */
#define _FCREAT         0x0040  /* open with file create */
#define _FTRUNC         0x0200  /* open with truncation */
#define _FTRUNC         0x0200  /* open with truncation */
#define _FEXCL          0x0080  /* error on open if file exists */
#define _FEXCL          0x0080  /* error on open if file exists */
#define _FNBIO      _FNONBLOCK  /* non blocking I/O (sys5 style) */
#define _FNBIO      _FNONBLOCK  /* non blocking I/O (sys5 style) */
#define _FSYNC          0x1000  /* do all writes synchronously */
#define _FSYNC          0x1000  /* do all writes synchronously */
#define _FNONBLOCK      0x0800  /* non blocking I/O (POSIX style) */
#define _FNONBLOCK      0x0800  /* non blocking I/O (POSIX style) */
#define _FNOCTTY        0x0100  /* don't assign a ctty on this open */
#define _FNOCTTY        0x0100  /* don't assign a ctty on this open */
 
 
#define O_ACCMODE       (O_RDONLY|O_WRONLY|O_RDWR)
#define O_ACCMODE       (O_RDONLY|O_WRONLY|O_RDWR)
 
 
/*
/*
 * Flag values for open(2) and fcntl(2)
 * Flag values for open(2) and fcntl(2)
 * The kernel adds 1 to the open modes to turn it into some
 * The kernel adds 1 to the open modes to turn it into some
 * combination of FREAD and FWRITE.
 * combination of FREAD and FWRITE.
 */
 */
#define O_RDONLY        0                /* +1 == FREAD */
#define O_RDONLY        0                /* +1 == FREAD */
#define O_WRONLY        1               /* +1 == FWRITE */
#define O_WRONLY        1               /* +1 == FWRITE */
#define O_RDWR          2               /* +1 == FREAD|FWRITE */
#define O_RDWR          2               /* +1 == FREAD|FWRITE */
#define O_APPEND        _FAPPEND
#define O_APPEND        _FAPPEND
#define O_CREAT         _FCREAT
#define O_CREAT         _FCREAT
#define O_TRUNC         _FTRUNC
#define O_TRUNC         _FTRUNC
#define O_EXCL          _FEXCL
#define O_EXCL          _FEXCL
/*      O_SYNC          _FSYNC          not posix, defined below */
/*      O_SYNC          _FSYNC          not posix, defined below */
/*      O_NDELAY        _FNDELAY        set in include/fcntl.h */
/*      O_NDELAY        _FNDELAY        set in include/fcntl.h */
/*      O_NDELAY        _FNBIO          set in 5include/fcntl.h */
/*      O_NDELAY        _FNBIO          set in 5include/fcntl.h */
#define O_NONBLOCK      _FNONBLOCK
#define O_NONBLOCK      _FNONBLOCK
#define O_NOCTTY        _FNOCTTY
#define O_NOCTTY        _FNOCTTY
 
 
#ifndef _POSIX_SOURCE
#ifndef _POSIX_SOURCE
 
 
#define O_SYNC          _FSYNC
#define O_SYNC          _FSYNC
 
 
/*
/*
 * Flags that work for fcntl(fd, F_SETFL, FXXXX)
 * Flags that work for fcntl(fd, F_SETFL, FXXXX)
 */
 */
#define FAPPEND         _FAPPEND
#define FAPPEND         _FAPPEND
#define FSYNC           _FSYNC
#define FSYNC           _FSYNC
#define FASYNC          _FASYNC
#define FASYNC          _FASYNC
#define FNBIO           _FNBIO
#define FNBIO           _FNBIO
#define FNONBIO         _FNONBLOCK      /* XXX fix to be NONBLOCK everywhere */
#define FNONBIO         _FNONBLOCK      /* XXX fix to be NONBLOCK everywhere */
#define FNDELAY         _FNDELAY
#define FNDELAY         _FNDELAY
 
 
/*
/*
 * Flags that are disallowed for fcntl's (FCNTLCANT);
 * Flags that are disallowed for fcntl's (FCNTLCANT);
 * used for opens, internal state, or locking.
 * used for opens, internal state, or locking.
 */
 */
#define FREAD           _FREAD
#define FREAD           _FREAD
#define FWRITE          _FWRITE
#define FWRITE          _FWRITE
#define FMARK           _FMARK
#define FMARK           _FMARK
#define FDEFER          _FDEFER
#define FDEFER          _FDEFER
#define FSHLOCK         _FSHLOCK
#define FSHLOCK         _FSHLOCK
#define FEXLOCK         _FEXLOCK
#define FEXLOCK         _FEXLOCK
 
 
/*
/*
 * The rest of the flags, used only for opens
 * The rest of the flags, used only for opens
 */
 */
#define FOPEN           _FOPEN
#define FOPEN           _FOPEN
#define FCREAT          _FCREAT
#define FCREAT          _FCREAT
#define FTRUNC          _FTRUNC
#define FTRUNC          _FTRUNC
#define FEXCL           _FEXCL
#define FEXCL           _FEXCL
#define FNOCTTY         _FNOCTTY
#define FNOCTTY         _FNOCTTY
 
 
#endif  /* !_POSIX_SOURCE */
#endif  /* !_POSIX_SOURCE */
 
 
/* XXX close on exec request; must match UF_EXCLOSE in user.h */
/* XXX close on exec request; must match UF_EXCLOSE in user.h */
#define FD_CLOEXEC      1       /* posix */
#define FD_CLOEXEC      1       /* posix */
 
 
/* fcntl(2) requests */
/* fcntl(2) requests */
#define F_DUPFD         0        /* dup */
#define F_DUPFD         0        /* dup */
#define F_GETFD         1       /* get f_flags */
#define F_GETFD         1       /* get f_flags */
#define F_SETFD         2       /* set f_flags */
#define F_SETFD         2       /* set f_flags */
#define F_GETFL         3       /* more flags (cloexec) */
#define F_GETFL         3       /* more flags (cloexec) */
#define F_SETFL         4
#define F_SETFL         4
#define F_GETLK         5
#define F_GETLK         5
#define F_SETLK         6
#define F_SETLK         6
#define F_SETLKW        7
#define F_SETLKW        7
 
 
#define F_SETOWN        8       /*  for sockets. */
#define F_SETOWN        8       /*  for sockets. */
#define F_GETOWN        9       /*  for sockets. */
#define F_GETOWN        9       /*  for sockets. */
 
 
/* for F_[GET|SET]FL */
/* for F_[GET|SET]FL */
#define FD_CLOEXEC      1       /* actually anything with low bit set goes */
#define FD_CLOEXEC      1       /* actually anything with low bit set goes */
 
 
/* for posix fcntl() and lockf() */
/* for posix fcntl() and lockf() */
#define F_RDLCK         0
#define F_RDLCK         0
#define F_WRLCK         1
#define F_WRLCK         1
#define F_UNLCK         2
#define F_UNLCK         2
 
 
/* for old implementation of bsd flock () */
/* for old implementation of bsd flock () */
#define F_EXLCK         4       /* or 3 */
#define F_EXLCK         4       /* or 3 */
#define F_SHLCK         8       /* or 4 */
#define F_SHLCK         8       /* or 4 */
 
 
/* operations for bsd flock(), also used by the kernel implementation */
/* operations for bsd flock(), also used by the kernel implementation */
#define LOCK_SH         1       /* shared lock */
#define LOCK_SH         1       /* shared lock */
#define LOCK_EX         2       /* exclusive lock */
#define LOCK_EX         2       /* exclusive lock */
#define LOCK_NB         4       /* or'd with one of the above to prevent
#define LOCK_NB         4       /* or'd with one of the above to prevent
                                   blocking */
                                   blocking */
#define LOCK_UN         8       /* remove lock */
#define LOCK_UN         8       /* remove lock */
 
 
/* file segment locking set data type - information passed to system by user */
/* file segment locking set data type - information passed to system by user */
struct flock {
struct flock {
        short   l_type;         /* F_RDLCK, F_WRLCK, or F_UNLCK */
        short   l_type;         /* F_RDLCK, F_WRLCK, or F_UNLCK */
        short   l_whence;       /* flag to choose starting offset */
        short   l_whence;       /* flag to choose starting offset */
        long    l_start;        /* relative offset, in bytes */
        long    l_start;        /* relative offset, in bytes */
        long    l_len;          /* length, in bytes; 0 means lock to EOF */
        long    l_len;          /* length, in bytes; 0 means lock to EOF */
        short   l_pid;          /* returned with F_GETLK */
        short   l_pid;          /* returned with F_GETLK */
        short   l_xxx;          /* reserved for future use */
        short   l_xxx;          /* reserved for future use */
};
};
 
 
#ifndef _POSIX_SOURCE
#ifndef _POSIX_SOURCE
/* extended file segment locking set data type */
/* extended file segment locking set data type */
struct eflock {
struct eflock {
        short   l_type;         /* F_RDLCK, F_WRLCK, or F_UNLCK */
        short   l_type;         /* F_RDLCK, F_WRLCK, or F_UNLCK */
        short   l_whence;       /* flag to choose starting offset */
        short   l_whence;       /* flag to choose starting offset */
        long    l_start;        /* relative offset, in bytes */
        long    l_start;        /* relative offset, in bytes */
        long    l_len;          /* length, in bytes; 0 means lock to EOF */
        long    l_len;          /* length, in bytes; 0 means lock to EOF */
        short   l_pid;          /* returned with F_GETLK */
        short   l_pid;          /* returned with F_GETLK */
        short   l_xxx;          /* reserved for future use */
        short   l_xxx;          /* reserved for future use */
        long    l_rpid;         /* Remote process id wanting this lock */
        long    l_rpid;         /* Remote process id wanting this lock */
        long    l_rsys;         /* Remote system id wanting this lock */
        long    l_rsys;         /* Remote system id wanting this lock */
};
};
#endif  /* !_POSIX_SOURCE */
#endif  /* !_POSIX_SOURCE */
 
 
 
 
#include <sys/types.h>
#include <sys/types.h>
#include <sys/stat.h>           /* sigh. for the mode bits for open/creat */
#include <sys/stat.h>           /* sigh. for the mode bits for open/creat */
 
 
extern int open _PARAMS ((const char *, int, ...));
extern int open _PARAMS ((const char *, int, ...));
extern int creat _PARAMS ((const char *, mode_t));
extern int creat _PARAMS ((const char *, mode_t));
extern int fcntl _PARAMS ((int, int, ...));
extern int fcntl _PARAMS ((int, int, ...));
 
 
/* Provide _<systemcall> prototypes for functions provided by some versions
/* Provide _<systemcall> prototypes for functions provided by some versions
   of newlib.  */
   of newlib.  */
#ifdef _COMPILING_NEWLIB
#ifdef _COMPILING_NEWLIB
extern int _open _PARAMS ((const char *, int, ...));
extern int _open _PARAMS ((const char *, int, ...));
extern int _fcntl _PARAMS ((int, int, ...));
extern int _fcntl _PARAMS ((int, int, ...));
#ifdef __LARGE64_FILES
#ifdef __LARGE64_FILES
extern int _open64 _PARAMS ((const char *, int, ...));
extern int _open64 _PARAMS ((const char *, int, ...));
#endif
#endif
#endif
#endif
 
 
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
#endif  /* !_FCNTL_ */
#endif  /* !_FCNTL_ */
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.