Squash commits for public release
This commit is contained in:
18
kernel/include/libkern/bits/sys/ioctls.h
Normal file
18
kernel/include/libkern/bits/sys/ioctls.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef _KERNEL_LIBKERN_BITS_SYS_IOCTLS_H
|
||||
#define _KERNEL_LIBKERN_BITS_SYS_IOCTLS_H
|
||||
|
||||
/* TTY */
|
||||
#define TIOCGPGRP 0x0101
|
||||
#define TIOCSPGRP 0x0102
|
||||
#define TCGETS 0x0103
|
||||
#define TCSETS 0x0104
|
||||
#define TCSETSW 0x0105
|
||||
#define TCSETSF 0x0106
|
||||
|
||||
/* BGA */
|
||||
#define BGA_SWAP_BUFFERS 0x0101
|
||||
#define BGA_GET_HEIGHT 0x0102
|
||||
#define BGA_GET_WIDTH 0x0103
|
||||
#define BGA_GET_SCALE 0x0104
|
||||
|
||||
#endif // _KERNEL_LIBKERN_BITS_SYS_IOCTLS_H
|
||||
27
kernel/include/libkern/bits/sys/mman.h
Normal file
27
kernel/include/libkern/bits/sys/mman.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef _KERNEL_LIBKERN_BITS_SYS_MMAN_H
|
||||
#define _KERNEL_LIBKERN_BITS_SYS_MMAN_H
|
||||
|
||||
#include <libkern/types.h>
|
||||
|
||||
#define MAP_SHARED 0x01
|
||||
#define MAP_PRIVATE 0x02
|
||||
#define MAP_FIXED 0x10
|
||||
#define MAP_ANONYMOUS 0x20
|
||||
#define MAP_STACK 0x40
|
||||
|
||||
#define PROT_READ 0x1
|
||||
#define PROT_WRITE 0x2
|
||||
#define PROT_EXEC 0x4
|
||||
#define PROT_NONE 0x0
|
||||
|
||||
struct mmap_params {
|
||||
void* addr;
|
||||
size_t size;
|
||||
int prot;
|
||||
int flags;
|
||||
int fd;
|
||||
off_t offset;
|
||||
};
|
||||
typedef struct mmap_params mmap_params_t;
|
||||
|
||||
#endif // _KERNEL_LIBKERN_BITS_SYS_MMAN_H
|
||||
12
kernel/include/libkern/bits/sys/ptrace.h
Normal file
12
kernel/include/libkern/bits/sys/ptrace.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef _KERNEL_LIBKERN_BITS_SYS_PTRACE_H
|
||||
#define _KERNEL_LIBKERN_BITS_SYS_PTRACE_H
|
||||
|
||||
#include <libkern/types.h>
|
||||
|
||||
typedef int ptrace_request_t;
|
||||
#define PTRACE_TRACEME (0x1)
|
||||
#define PTRACE_CONT (0x2)
|
||||
#define PTRACE_PEEKTEXT (0x3)
|
||||
#define PTRACE_PEEKDATA (0x4)
|
||||
|
||||
#endif // _KERNEL_LIBKERN_BITS_SYS_PTRACE_H
|
||||
18
kernel/include/libkern/bits/sys/select.h
Normal file
18
kernel/include/libkern/bits/sys/select.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef _KERNEL_LIBKERN_BITS_SYS_SELECT_H
|
||||
#define _KERNEL_LIBKERN_BITS_SYS_SELECT_H
|
||||
|
||||
#include <libkern/types.h>
|
||||
|
||||
#define FD_SETSIZE 32
|
||||
|
||||
struct fd_set {
|
||||
uint8_t fds[FD_SETSIZE / 8];
|
||||
};
|
||||
typedef struct fd_set fd_set_t;
|
||||
|
||||
#define FD_SET(fd, fd_set_ptr) ((fd_set_ptr)->fds[fd / 8] |= (1 << (fd % 8)))
|
||||
#define FD_CLR(fd, fd_set_ptr) ((fd_set_ptr)->fds[fd / 8] &= ~(1 << (fd % 8)))
|
||||
#define FD_ZERO(fd_set_ptr) (memset((uint8_t*)(fd_set_ptr), 0, sizeof(fd_set_t)))
|
||||
#define FD_ISSET(fd, fd_set_ptr) ((fd_set_ptr)->fds[fd / 8] & (1 << (fd % 8)))
|
||||
|
||||
#endif // _KERNEL_LIBKERN_BITS_SYS_SELECT_H
|
||||
26
kernel/include/libkern/bits/sys/socket.h
Normal file
26
kernel/include/libkern/bits/sys/socket.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef _KERNEL_LIBKERN_BITS_SYS_SOCKET_H
|
||||
#define _KERNEL_LIBKERN_BITS_SYS_SOCKET_H
|
||||
|
||||
enum SOCK_DOMAINS {
|
||||
PF_LOCAL,
|
||||
PF_INET,
|
||||
PF_INET6,
|
||||
PF_IPX,
|
||||
PF_NETLINK,
|
||||
PF_X25,
|
||||
PF_AX25,
|
||||
PF_ATMPVC,
|
||||
PF_APPLETALK,
|
||||
PF_PACKET,
|
||||
};
|
||||
|
||||
enum SOCK_TYPES {
|
||||
SOCK_STREAM,
|
||||
SOCK_DGRAM,
|
||||
SOCK_SEQPACKET,
|
||||
SOCK_RAW,
|
||||
SOCK_RDM,
|
||||
SOCK_PACKET,
|
||||
};
|
||||
|
||||
#endif // _KERNEL_LIBKERN_BITS_SYS_SOCKET_H
|
||||
64
kernel/include/libkern/bits/sys/stat.h
Normal file
64
kernel/include/libkern/bits/sys/stat.h
Normal file
@@ -0,0 +1,64 @@
|
||||
#ifndef _KERNEL_LIBKERN_BITS_SYS_STAT_H
|
||||
#define _KERNEL_LIBKERN_BITS_SYS_STAT_H
|
||||
|
||||
#include <libkern/bits/time.h>
|
||||
#include <libkern/types.h>
|
||||
|
||||
#define S_IFMT 0xF000
|
||||
|
||||
/* MODES */
|
||||
#define S_IFSOCK 0xC000 /* [XSI] socket */
|
||||
#define S_IFLNK 0xA000 /* [XSI] symbolic link */
|
||||
#define S_IFREG 0x8000 /* [XSI] regular */
|
||||
#define S_IFBLK 0x6000 /* [XSI] block special */
|
||||
#define S_IFDIR 0x4000 /* [XSI] directory */
|
||||
#define S_IFCHR 0x2000 /* [XSI] character special */
|
||||
#define S_IFIFO 0x1000 /* [XSI] named pipe (fifo) */
|
||||
|
||||
#define S_ISUID 0x0800
|
||||
#define S_ISGID 0x0400
|
||||
#define S_ISVTX 0x0200
|
||||
|
||||
/* Read, write, execute/search by owner */
|
||||
#define S_IRWXU 0x01c0
|
||||
#define S_IRUSR 0x0100
|
||||
#define S_IWUSR 0x0080
|
||||
#define S_IXUSR 0x0040
|
||||
/* Read, write, execute/search by group */
|
||||
#define S_IRWXG 0x0038
|
||||
#define S_IRGRP 0x0020
|
||||
#define S_IWGRP 0x0010
|
||||
#define S_IXGRP 0x0008
|
||||
/* Read, write, execute/search by others */
|
||||
#define S_IRWXO 0x0007
|
||||
#define S_IROTH 0x0004
|
||||
#define S_IWOTH 0x0002
|
||||
#define S_IXOTH 0x0001
|
||||
|
||||
#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
|
||||
#define S_ISCHR(m) (((m)&S_IFMT) == S_IFCHR)
|
||||
#define S_ISBLK(m) (((m)&S_IFMT) == S_IFBLK)
|
||||
#define S_ISREG(m) (((m)&S_IFMT) == S_IFREG)
|
||||
#define S_ISFIFO(m) (((m)&S_IFMT) == S_IFIFO)
|
||||
#define S_ISLNK(m) (((m)&S_IFMT) == S_IFLNK)
|
||||
#define S_ISSOCK(m) (((m)&S_IFMT) == S_IFSOCK)
|
||||
|
||||
struct stat {
|
||||
dev_t st_dev; /* ID of device containing file */
|
||||
ino_t st_ino; /* Inode number */
|
||||
mode_t st_mode; /* File type and mode */
|
||||
nlink_t st_nlink; /* Number of hard links */
|
||||
uid_t st_uid; /* User ID of owner */
|
||||
gid_t st_gid; /* Group ID of owner */
|
||||
dev_t st_rdev; /* Device ID (if special file) */
|
||||
off_t st_size; /* Total size, in bytes */
|
||||
uint32_t st_blksize; /* Block size for filesystem I/O */
|
||||
uint32_t st_blocks; /* Number of 512B blocks allocated */
|
||||
|
||||
struct timespec st_atim; /* Time of last access */
|
||||
struct timespec st_mtim; /* Time of last modification */
|
||||
struct timespec st_ctim; /* Time of last status change */
|
||||
};
|
||||
typedef struct stat stat_t;
|
||||
|
||||
#endif // _KERNEL_LIBKERN_BITS_SYS_STAT_H
|
||||
15
kernel/include/libkern/bits/sys/utsname.h
Normal file
15
kernel/include/libkern/bits/sys/utsname.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#ifndef _KERNEL_LIBKERN_BITS_SYS_UTSNAME_H
|
||||
#define _KERNEL_LIBKERN_BITS_SYS_UTSNAME_H
|
||||
|
||||
#define UTSNAME_ENTRY_LEN 65
|
||||
|
||||
struct utsname {
|
||||
char sysname[UTSNAME_ENTRY_LEN];
|
||||
char nodename[UTSNAME_ENTRY_LEN];
|
||||
char release[UTSNAME_ENTRY_LEN];
|
||||
char version[UTSNAME_ENTRY_LEN];
|
||||
char machine[UTSNAME_ENTRY_LEN];
|
||||
};
|
||||
typedef struct utsname utsname_t;
|
||||
|
||||
#endif // _KERNEL_LIBKERN_BITS_SYS_UTSNAME_H
|
||||
7
kernel/include/libkern/bits/sys/wait.h
Normal file
7
kernel/include/libkern/bits/sys/wait.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#ifndef _KERNEL_LIBKERN_BITS_SYS_WAIT_H
|
||||
#define _KERNEL_LIBKERN_BITS_SYS_WAIT_H
|
||||
|
||||
#define WNOHANG 0x1
|
||||
#define WUNTRACED 0x2
|
||||
|
||||
#endif // _KERNEL_LIBKERN_BITS_SYS_WAIT_H
|
||||
Reference in New Issue
Block a user