1 /* -*-comment-start: "//";comment-end:""-*-
2 * GNU Mes --- Maxwell Equations of Software
3 * Copyright © 2016,2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
5 * This file is part of GNU Mes.
7 * GNU Mes is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or (at
10 * your option) any later version.
12 * GNU Mes is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
21 #define SYS_close 0x06
22 #define SYS_lseek 0x13
23 #define SYS_unlink 0x0a
24 #define SYS_rmdir 0x28
26 #define SYS_getcwd 0xb7
31 if (_ungetc_fd == filedes)
36 return _sys_call1 (SYS_close, (int)filedes);
40 lseek (int filedes, off_t offset, int whence)
42 return _sys_call3 (SYS_lseek, (int)filedes, (int)offset, (int)whence);
46 unlink (char const *file_name)
48 return _sys_call1 (SYS_unlink, (int)file_name);
52 rmdir (char const *file_name)
54 return _sys_call1 (SYS_rmdir, (int)file_name);
58 stat (char const *file_name, struct stat *statbuf)
60 return _sys_call2 (SYS_stat, (int)file_name, (int)statbuf);
64 getcwd (char *buffer, size_t size)
66 return _sys_call2 (SYS_getcwd, (int)buffer, (int)size);