aboutsummaryrefslogtreecommitdiffstats
path: root/unixio.h
blob: bc0a86c85c7a0abda4453835af03b1931424787e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* written by Paul Edwards */
/* released to the public domain */

#ifndef UNIXIO_INCLUDED
#define UNIXIO_INCLUDED

#include <stddef.h>

#define S_IFBLK 0x3000
#define S_IFDIR 0x4000
#define S_IFREG 0x8000
#define S_IFMT 0xf000

#ifndef ENOENT
#define ENOENT 2002
#endif
#ifndef ENOTDIR
#define ENOTDIR 2045
#endif

#define O_RDONLY 1
#define O_WRONLY 2
#define O_RDWR 4
#define O_CREAT 0x100
#define O_TRUNC 0x200

struct stat {
  long st_size;
  long st_mode;
  long st_ino;
  long st_dev;
  long st_mtime;
};

int open(const char *fnm, int mode, ...);
int read(int fno, void *buf, size_t bytes);
int write(int fno, const void *buf, size_t bytes);
int close(int fno);
char *mktemp(char *s);

#endif
Un proyecto texto-plano.xyz