12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- /*
- * unistd.h
- *
- * Copyright (C) 2017 Aleksandar Andrejevic <theflash@sdf.lonestar.org>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- #ifndef _UNISTD_H_
- #define _UNISTD_H_
- #include <mlcrt.h>
- #include <stddef.h>
- #include <stdint.h>
- #define PATH_MAX 16384
- #define STDIN_FILENO 0
- #define STDOUT_FILENO 1
- #define STDERR_FILENO 2
- #define O_RDONLY 0
- #define O_WRONLY 1
- #define O_RDWR 2
- #define O_CREAT (1 << 6)
- #define O_EXCL (1 << 7)
- #define O_TRUNC (1 << 9)
- #define O_APPEND (1 << 10)
- #define O_NONBLOCK (1 << 11)
- #define SEEK_SET 0
- #define SEEK_CUR 1
- #define SEEK_END 2
- typedef uint16_t mode_t;
- typedef ptrdiff_t off_t;
- typedef ptrdiff_t ssize_t;
- char *__CRT_PUBLIC(getcwd)(char *buf, size_t size);
- char *__CRT_PUBLIC(getwd)(char *buf);
- char *__CRT_PUBLIC(get_current_dir_name)(void);
- int __CRT_PUBLIC(fchdir)(int fd);
- int __CRT_PUBLIC(chdir)(const char *path);
- #ifndef __DONT_DEFINE_OPEN__
- int __CRT_PUBLIC(open)(const char *pathname, int flags, ...);
- #endif
- int __CRT_PUBLIC(creat)(const char *pathname, mode_t mode);
- int __CRT_PUBLIC(close)(int fd);
- ssize_t __CRT_PUBLIC(read)(int fd, void *buf, size_t count);
- ssize_t __CRT_PUBLIC(write)(int fd, const void *buf, size_t count);
- off_t __CRT_PUBLIC(lseek)(int fd, off_t offset, int whence);
- #endif
|