renamed and cleaned up export header files to match linux convention eme/usr-header-gen
authorLunaixsky <lunaixsky@qq.com>
Mon, 5 May 2025 14:10:48 +0000 (15:10 +0100)
committerLunaixsky <lunaixsky@qq.com>
Mon, 5 May 2025 14:10:48 +0000 (15:10 +0100)
56 files changed:
lunaix-os/hal/term/term.c
lunaix-os/includes/hal/term.h
lunaix-os/includes/lunaix/foptions.h
lunaix-os/includes/lunaix/fs/api.h
lunaix-os/includes/lunaix/ioctl.h
lunaix-os/includes/lunaix/mm/mm.h
lunaix-os/includes/lunaix/process.h
lunaix-os/includes/lunaix/signal.h
lunaix-os/includes/lunaix/types.h
lunaix-os/includes/usr/headers
lunaix-os/includes/usr/lunaix/device.h
lunaix-os/includes/usr/lunaix/dirent.h [moved from lunaix-os/includes/usr/lunaix/dirent_defs.h with 68% similarity]
lunaix-os/includes/usr/lunaix/fcntl.h [new file with mode: 0644]
lunaix-os/includes/usr/lunaix/fcntl_defs.h [deleted file]
lunaix-os/includes/usr/lunaix/fstypes.h
lunaix-os/includes/usr/lunaix/gfx.h
lunaix-os/includes/usr/lunaix/ioctl.h [moved from lunaix-os/includes/usr/lunaix/ioctl_defs.h with 83% similarity]
lunaix-os/includes/usr/lunaix/mman.h [moved from lunaix-os/includes/usr/lunaix/mann_flags.h with 88% similarity]
lunaix-os/includes/usr/lunaix/poll.h
lunaix-os/includes/usr/lunaix/serial.h
lunaix-os/includes/usr/lunaix/signal.h [moved from lunaix-os/includes/usr/lunaix/signal_defs.h with 81% similarity]
lunaix-os/includes/usr/lunaix/status.h
lunaix-os/includes/usr/lunaix/term.h
lunaix-os/includes/usr/lunaix/threads.h
lunaix-os/includes/usr/lunaix/types.h
lunaix-os/includes/usr/lunaix/wait.h [new file with mode: 0644]
lunaix-os/kernel/device/devfs.c
lunaix-os/kernel/fs/iso9660/directory.c
lunaix-os/kernel/fs/path_walk.c
lunaix-os/kernel/fs/vfs.c
lunaix-os/kernel/mm/mmap.c
lunaix-os/kernel/process/taskfs.c
lunaix-os/usr/init/init.c
lunaix-os/usr/libc/includes/dirent.h
lunaix-os/usr/libc/includes/fcntl.h
lunaix-os/usr/libc/includes/lunaix/syscall.h [deleted file]
lunaix-os/usr/libc/includes/signal.h
lunaix-os/usr/libc/includes/sys/ioctl.h [moved from lunaix-os/usr/libc/includes/lunaix/ioctl.h with 80% similarity]
lunaix-os/usr/libc/includes/sys/lunaix.h [moved from lunaix-os/usr/libc/includes/lunaix/lunaix.h with 69% similarity]
lunaix-os/usr/libc/includes/sys/mman.h [moved from lunaix-os/usr/libc/includes/lunaix/mann.h with 80% similarity]
lunaix-os/usr/libc/includes/sys/mount.h [moved from lunaix-os/usr/libc/includes/lunaix/mount.h with 92% similarity]
lunaix-os/usr/libc/includes/sys/types.h [new file with mode: 0644]
lunaix-os/usr/libc/includes/sys/wait.h [new file with mode: 0644]
lunaix-os/usr/libc/includes/unistd.h
lunaix-os/usr/libc/src/posix/dirent.c
lunaix-os/usr/libc/src/posix/ioctl.c
lunaix-os/usr/libc/src/posix/lunaix.c
lunaix-os/usr/libc/src/posix/mann.c
lunaix-os/usr/libc/src/posix/signal.c
lunaix-os/usr/libc/src/posix/unistd.c
lunaix-os/usr/libc/src/termios.c
lunaix-os/usr/maze.c
lunaix-os/usr/sh/sh.c
lunaix-os/usr/signal_demo.c
lunaix-os/usr/stat.c
lunaix-os/usr/testp.c

index a71f93ca688089445cfc1d8b5ac77002153a2c29..59b7ebe81de1e5c96c53ec03aadfa17591cbd650 100644 (file)
@@ -7,7 +7,7 @@
 #include <lunaix/status.h>
 #include <lunaix/syslog.h>
 
-#include <usr/lunaix/ioctl_defs.h>
+#include <usr/lunaix/ioctl.h>
 
 LOG_MODULE("term");
 
index be7abd0fdcda89163fb59139079e4b0299d2231f..07acec91f43566e37d0847cb91d3a1a93d92a1f6 100644 (file)
@@ -4,8 +4,8 @@
 #include <lunaix/device.h>
 #include <lunaix/ds/rbuffer.h>
 #include <lunaix/ds/waitq.h>
-#include <lunaix/signal_defs.h>
 
+#include <usr/lunaix/signal.h>
 #include <usr/lunaix/term.h>
 
 struct term;
index 38b055a9d18dd1b3a73ed6e7cccf02b3bb38361a..3ed7592f0c226e559a077bbdb82407471affca8c 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef __LUNAIX_FOPTIONS_H
 #define __LUNAIX_FOPTIONS_H
 
-#include <usr/lunaix/fcntl_defs.h>
+#include <usr/lunaix/fcntl.h>
 
 #endif /* __LUNAIX_FOPTIONS_H */
index e9c1437fbad306724f8c956962fbdbbbd89748b4..81aaa56be50683cf5beeb0939f088a2ecaa82982 100644 (file)
@@ -2,11 +2,11 @@
 #define __LUNAIX_FSAPI_H
 
 #include <lunaix/fs.h>
-#include <lunaix/fcntl_defs.h>
 #include <lunaix/blkbuf.h>
 #include <klibc/string.h>
 
-#include <usr/lunaix/dirent_defs.h>
+#include <usr/lunaix/fcntl.h>
+#include <usr/lunaix/dirent.h>
 
 struct fsapi_vsb_ops
 {
index ed7c4f7316e7a82265506f7c3aecbd03b1e0a76f..0b8f0ac91fa481f18e8fe23b5ff47fb6f51e3fb9 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef __LUNAIX_IOCTL_H
 #define __LUNAIX_IOCTL_H
 
-#include <usr/lunaix/ioctl_defs.h>
+#include <usr/lunaix/ioctl.h>
 
 #endif /* __LUNAIX_IOCTL_H */
index abb18cf1545b74b11608db8441aa2bf278153a30..742ee1d4139cd1532c234bbc08138ec54dd413e6 100644 (file)
@@ -6,7 +6,7 @@
 
 #include <asm/pagetable.h>
 
-#include <usr/lunaix/mann_flags.h>
+#include <usr/lunaix/mman.h>
 
 /**
  * @brief 私有区域,该区域中的页无法进行任何形式的共享。
index 868a9fc290bc97a53ee3bac804b401cf87da54fd..a9f307c704a8688b521cccd8c1817cc39658cd11 100644 (file)
@@ -15,6 +15,8 @@
 #include <lunaix/hart_state.h>
 #include <lunaix/usrscope.h>
 
+#include <usr/lunaix/wait.h>
+
 #include <stdint.h>
 
 
index 556823b7d4632aee2d56d9ab5e7dec29e2c08047..63723254e33681413220267e449acffb8c1ec5a6 100644 (file)
@@ -2,7 +2,7 @@
 #define __LUNAIX_SIGNAL_H
 
 #include <lunaix/types.h>
-#include <usr/lunaix/signal_defs.h>
+#include <usr/lunaix/signal.h>
 
 #define _SIG_NUM 16
 
index 6ce5fcf3b71873e3ea2b7ce4243c03bff658aac0..c7b09e87acd8a3f0cbc2b7710142de3e244e905a 100644 (file)
@@ -1,33 +1,39 @@
 #ifndef __LUNAIX_TYPES_H
 #define __LUNAIX_TYPES_H
 
+#include <stdarg.h>
 #include <lunaix/compiler.h>
 #include <lunaix/limits.h>
-#include <stdarg.h>
 #include <usr/lunaix/types.h>
 
-// TODO: WTERMSIG
-
-// TODO: replace the integer type with these. To make thing more portable.
+#undef  NULL
+#define NULL                (void*)0
 
-typedef unsigned char u8_t;
-typedef unsigned short u16_t;
-typedef unsigned int u32_t;
-typedef unsigned long ptr_t;
-typedef unsigned long reg_t;
+typedef unsigned char       u8_t;
+typedef unsigned short      u16_t;
+typedef unsigned int        u32_t;
 
 #ifndef CONFIG_ARCH_BITS_64
-typedef unsigned long long u64_t;
+typedef unsigned long long  u64_t;
 #else
-typedef unsigned long u64_t;
+typedef unsigned long       u64_t;
 #endif
 
-typedef int pid_t;
-typedef signed long ssize_t;
+typedef __lunaix_pid_t      pid_t;
+typedef __lunaix_tid_t      tid_t;
+typedef __lunaix_uid_t      uid_t;
+typedef __lunaix_gid_t      gid_t;
+typedef __lunaix_size_t     size_t;
+typedef __lunaix_ssize_t    ssize_t;
+typedef __lunaix_size_t     off_t;
+typedef __lunaix_ino_t      ino_t;
 
-typedef unsigned int cpu_t;
+typedef unsigned long       ptr_t;
+typedef unsigned long       reg_t;
+typedef unsigned int        cpu_t;
+typedef u64_t               lba_t;
 
-typedef u64_t lba_t;
+typedef __lunaix_dev_t      dev_t;
 
 #define true 1
 #define false 0
index 1a4af01f1ade1573aee93f4ae67b9857013d09a6..5e33d5afdbbcb4e2ffeaca8e20529ff2745d1992 100644 (file)
@@ -1,14 +1,15 @@
 lunaix/fstypes.h
 lunaix/status.h
-lunaix/fcntl_defs.h
-lunaix/signal_defs.h
+lunaix/fcntl.h
+lunaix/signal.h
 lunaix/term.h
-lunaix/mann_flags.h
-lunaix/dirent_defs.h
+lunaix/mman.h
+lunaix/dirent.h
 lunaix/poll.h
 lunaix/types.h
 lunaix/serial.h
 lunaix/device.h
-lunaix/ioctl_defs.h
+lunaix/ioctl.h
 lunaix/threads.h
 lunaix/gfx.h
+lunaix/wait.h
index 9f8d2e03aed869ac185eebddc30a65929e507238..4e4c4197d4f979f919c5518a7fafcea99be943b9 100644 (file)
@@ -1,7 +1,7 @@
-#ifndef __LUNAIX_UDEVICE_H
-#define __LUNAIX_UDEVICE_H
+#ifndef _LUNAIX_UHDR_UDEVICE_H
+#define _LUNAIX_UHDR_UDEVICE_H
 
-#include "ioctl_defs.h"
+#include "ioctl.h"
 
 struct dev_info
 {
@@ -20,4 +20,4 @@ struct dev_info
     } dev_name;
 };
 
-#endif /* __LUNAIX_UDEVICE_H */
+#endif /* _LUNAIX_UHDR_UDEVICE_H */
similarity index 68%
rename from lunaix-os/includes/usr/lunaix/dirent_defs.h
rename to lunaix-os/includes/usr/lunaix/dirent.h
index 9142a4dc440d8ea802fa9ee65ea967ba73fbe412..d8342ddb72ea9725f23715ed1b07a18d3e10d670 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __LUNAIX_SYS_DIRENT_DEFS_H
-#define __LUNAIX_SYS_DIRENT_DEFS_H
+#ifndef _LUNAIX_UHDR_SYS_DIRENT_DEFS_H
+#define _LUNAIX_UHDR_SYS_DIRENT_DEFS_H
 
 #define DIRENT_NAME_MAX_LEN 256
 
@@ -16,4 +16,4 @@ struct lx_dirent
     char d_name[DIRENT_NAME_MAX_LEN];
 };
 
-#endif /* __LUNAIX_DIRENT_DEFS_H */
+#endif /* _LUNAIX_UHDR_DIRENT_DEFS_H */
diff --git a/lunaix-os/includes/usr/lunaix/fcntl.h b/lunaix-os/includes/usr/lunaix/fcntl.h
new file mode 100644 (file)
index 0000000..ba88b5b
--- /dev/null
@@ -0,0 +1,68 @@
+#ifndef _LUNAIX_UHDR_SYS_FCNTL_DEFS_H
+#define _LUNAIX_UHDR_SYS_FCNTL_DEFS_H
+
+#include "fstypes.h"
+#include "types.h"
+
+#define FO_CREATE               0x1
+#define FO_APPEND               0x2
+#define FO_DIRECT               0x4
+#define FO_WRONLY               0x8
+#define FO_RDONLY               0x10
+#define FO_RDWR                 0x20
+#define FO_TRUNC                0x40
+
+#define FO_NOFOLLOW             0x10000
+
+#define FSEEK_SET               0x1
+#define FSEEK_CUR               0x2
+#define FSEEK_END               0x3
+
+#define O_CREAT                 FO_CREATE
+#define O_APPEND                FO_APPEND
+#define O_DIRECT                FO_DIRECT
+#define O_WRONLY                FO_WRONLY
+#define O_RDONLY                FO_RDONLY
+#define O_RDWR                  FO_RDWR
+#define O_TRUNC                 FO_TRUNC
+
+#define AT_SYMLINK_FOLLOW       0b0000
+#define AT_SYMLINK_NOFOLLOW     0b0001
+#define AT_FDCWD                0b0010
+#define AT_EACCESS              0b0100
+
+#define R_OK                    0b100100100
+#define W_OK                    0b010010010
+#define X_OK                    0b001001001
+#define F_OK                    0b111111111
+
+/* Mount with read-only flag */
+#define MNT_RO                  (1 << 0)
+
+/* Mount with block-cache-disabled flag */
+#define MNT_NC                  (1 << 1)
+
+typedef unsigned int mode_t;
+typedef unsigned int nlink_t;
+
+struct file_stat
+{
+    __lunaix_dev_t   st_dev;
+    __lunaix_ino_t   st_ino;
+    mode_t           st_mode;
+    nlink_t          st_nlink;
+    __lunaix_uid_t   st_uid;
+    __lunaix_gid_t   st_gid;
+    __lunaix_dev_t   st_rdev;
+    __lunaix_size_t  st_size;
+    __lunaix_size_t  st_blksize;
+    __lunaix_size_t  st_blocks;
+
+    unsigned long    st_atim;
+    unsigned long    st_ctim;
+    unsigned long    st_mtim;
+
+    __lunaix_size_t  st_ioblksize;
+};
+
+#endif /* _LUNAIX_UHDR_FNCTL_DEFS_H */
diff --git a/lunaix-os/includes/usr/lunaix/fcntl_defs.h b/lunaix-os/includes/usr/lunaix/fcntl_defs.h
deleted file mode 100644 (file)
index 36af62e..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-#ifndef __LUNAIX_SYS_FCNTL_DEFS_H
-#define __LUNAIX_SYS_FCNTL_DEFS_H
-
-#include "fstypes.h"
-#include "types.h"
-
-#define FO_CREATE   0x1
-#define FO_APPEND   0x2
-#define FO_DIRECT   0x4
-#define FO_WRONLY   0x8
-#define FO_RDONLY   0x10
-#define FO_RDWR     0x20
-#define FO_TRUNC    0x40
-
-#define FO_NOFOLLOW 0x10000
-
-#define FSEEK_SET 0x1
-#define FSEEK_CUR 0x2
-#define FSEEK_END 0x3
-
-#define O_CREAT FO_CREATE
-#define O_APPEND FO_APPEND
-#define O_DIRECT FO_DIRECT
-#define O_WRONLY FO_WRONLY
-#define O_RDONLY FO_RDONLY
-#define O_RDWR FO_RDWR
-#define O_TRUNC FO_TRUNC
-
-#define AT_SYMLINK_FOLLOW       0b0000
-#define AT_SYMLINK_NOFOLLOW     0b0001
-#define AT_FDCWD                0b0010
-#define AT_EACCESS              0b0100
-
-#define R_OK                    0b100100100
-#define W_OK                    0b010010010
-#define X_OK                    0b001001001
-#define F_OK                    0b111111111
-
-/* Mount with read-only flag */
-#define MNT_RO (1 << 0)
-
-/* Mount with block-cache-disabled flag */
-#define MNT_NC (1 << 1)
-
-typedef unsigned int mode_t;
-typedef unsigned int nlink_t;
-
-struct file_stat
-{
-    dev_t   st_dev;
-    ino_t   st_ino;
-    mode_t  st_mode;
-    nlink_t st_nlink;
-    uid_t   st_uid;
-    gid_t   st_gid;
-    dev_t   st_rdev;
-    off_t   st_size;
-    size_t  st_blksize;
-    size_t  st_blocks;
-
-    unsigned long st_atim;
-    unsigned long st_ctim;
-    unsigned long st_mtim;
-
-    size_t  st_ioblksize;
-};
-
-#endif /* __LUNAIX_FNCTL_DEFS_H */
index 680a8222f7d34dcb6548ecdf4ccf6c7104f44db4..9bbd4284fd5b78f7df9a5c758d52f0d3b844e6b1 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __LUNAIX_FSTYPES_H
-#define __LUNAIX_FSTYPES_H
+#ifndef _LUNAIX_UHDR_FSTYPES_H
+#define _LUNAIX_UHDR_FSTYPES_H
 
 /*
   7 6 5 4 3   2 1 0
@@ -20,4 +20,4 @@
 #define F_PIPE      0b00010000
 #define F_SYMLINK   0b00100000
 
-#endif /* __LUNAIX_FSTYPES_H */
+#endif /* _LUNAIX_UHDR_FSTYPES_H */
index e583be1e850f3fd3c1d078377b58effd54393eda..6c5e5d89b5380f46500fd5c516322f4d1c079ded 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __LUNAIX_UGFX_H
-#define __LUNAIX_UGFX_H
+#ifndef _LUNAIX_UHDR_UGFX_H
+#define _LUNAIX_UHDR_UGFX_H
 
 #define GFX_CMDA(type, cmd_id) (((type) << 8) | ((cmd_id) & 0xf))
 
@@ -41,4 +41,4 @@ struct gfxa_clut
     size_t len;
 };
 
-#endif /* __LUNAIX_UGFX_H */
+#endif /* _LUNAIX_UHDR_UGFX_H */
similarity index 83%
rename from lunaix-os/includes/usr/lunaix/ioctl_defs.h
rename to lunaix-os/includes/usr/lunaix/ioctl.h
index dd5709f6ca99c9559e923062129fdd83dce6389c..44254b9eadcdc24192b92a8a69ec6456acd08952 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __LUNAIX_SYS_IOCTL_DEFS_H
-#define __LUNAIX_SYS_IOCTL_DEFS_H
+#ifndef _LUNAIX_UHDR_SYS_IOCTL_H
+#define _LUNAIX_UHDR_SYS_IOCTL_H
 
 #define IOREQ(cmd, arg_num) ((((cmd) & 0xffff) << 8) | ((arg_num) & 0xff))
 
@@ -22,4 +22,4 @@
 
 #define TIMERIO_GETINFO IOREQ(1, 0)
 
-#endif /* __LUNAIX_IOCTL_DEFS_H */
+#endif /* _LUNAIX_UHDR_IOCTL_H */
similarity index 88%
rename from lunaix-os/includes/usr/lunaix/mann_flags.h
rename to lunaix-os/includes/usr/lunaix/mman.h
index dcd3a3479282c2252c8ac84637b79bd62cf66370..8f9641d65d521ac949f2cdb23c4711ad0d41083e 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __LUNAIX_SYS_MANN_FLAGS_H
-#define __LUNAIX_SYS_MANN_FLAGS_H
+#ifndef _LUNAIX_UHDR_SYS_MMAN_H
+#define _LUNAIX_UHDR_SYS_MMAN_H
 
 // POSIX compliant.
 
@@ -40,4 +40,4 @@ struct usr_mmap_param
     unsigned long offset;
 };
 
-#endif /* __LUNAIX_MANN_FLAGS_H */
+#endif /* _LUNAIX_UHDR_MMAN_H */
index 8fed581f120f8140d0a43b77c4874f845cedbfca..62631561f5dd467f67d07eb0bd8c8803f80958d5 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __LUNAIX_UPOLL_H
-#define __LUNAIX_UPOLL_H
+#ifndef _LUNAIX_UHDR_UPOLL_H
+#define _LUNAIX_UHDR_UPOLL_H
 
 struct poll_info
 {
@@ -25,4 +25,4 @@ struct poll_info
 #define _POLLEE_ALWAYS 1
 #define _POLLEE_RM_ON_ERR (1 << 1)
 
-#endif /* __LUNAIX_UPOLL_H */
+#endif /* _LUNAIX_UHDR_UPOLL_H */
index 6f731554547d6f8ffa03d896bbaf8f767de66191..ee10002198462bd78242b8a4a0c7c136434a239a 100644 (file)
@@ -1,7 +1,7 @@
-#ifndef __LUNAIX_USERIAL_H
-#define __LUNAIX_USERIAL_H
+#ifndef _LUNAIX_UHDR_USERIAL_H
+#define _LUNAIX_UHDR_USERIAL_H
 
-#include "ioctl_defs.h"
+#include "ioctl.h"
 
 #define SERIO_RXEN          IOREQ(1, 0)
 #define SERIO_RXDA          IOREQ(2, 0)
@@ -13,4 +13,4 @@
 #define SERIO_SETCNTRLMODE  IOREQ(6, 0)
 #define SERIO_SETBRDBASE    IOREQ(7, 0)
 
-#endif /* __LUNAIX_USERIAL_H */
+#endif /* _LUNAIX_UHDR_USERIAL_H */
similarity index 81%
rename from lunaix-os/includes/usr/lunaix/signal_defs.h
rename to lunaix-os/includes/usr/lunaix/signal.h
index 7c8148a20bc5ffa29a19886560e216b16fda0254..18b28ee0cbb8850934f50ff9fae19b3719df4db3 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __LUNAIX_SYS_SIGNAL_DEFS_H
-#define __LUNAIX_SYS_SIGNAL_DEFS_H
+#ifndef _LUNAIX_UHDR_SYS_SIGNAL_DEFS_H
+#define _LUNAIX_UHDR_SYS_SIGNAL_DEFS_H
 
 #define SIGALRM 1
 #define SIGCHLD 2
@@ -35,4 +35,4 @@ struct siginfo
     // TODO
 };
 
-#endif /* __LUNAIX_SIGNAL_DEFS_H */
+#endif /* _LUNAIX_UHDR_SIGNAL_DEFS_H */
index 5ba3438f1f25d7db724139c9bca34be0e4417dfe..49657872fdfca96f68dd249df800748e2d84a1fb 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __LUNAIX_STATUS_H
-#define __LUNAIX_STATUS_H
+#ifndef _LUNAIX_UHDR_STATUS_H
+#define _LUNAIX_UHDR_STATUS_H
 
 #define ENOMEM              -3
 #define EINVAL              -6
@@ -32,4 +32,4 @@
 #define EPERM               -33
 #define EACCESS             -34
 
-#endif /* __LUNAIX_STATUS_H */
+#endif /* _LUNAIX_UHDR_STATUS_H */
index b1f6c1fff37eef5ec71d9c84b30123eeb94edc59..e9d79024819698d3bee7ff66ffb0e8b5ec523a16 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __LUNAIX_UTERM_H
-#define __LUNAIX_UTERM_H
+#ifndef _LUNAIX_UHDR_UTERM_H
+#define _LUNAIX_UHDR_UTERM_H
 
 #define _BRKINT (1)
 #define _ICRNL (1 << 1)
@@ -104,4 +104,4 @@ struct termios
     speed_t c_baud;
 };
 
-#endif /* __LUNAIX_UTERM_H */
+#endif /* _LUNAIX_UHDR_UTERM_H */
index a20b52ff69afe5bd689ed1ef399baad7d5c6ed5e..c70e40711df21058cfff43c8a49efe117b07cef5 100644 (file)
@@ -1,11 +1,12 @@
-#ifndef __LUNAIX_USR_THREADS_H
-#define __LUNAIX_USR_THREADS_H
+#ifndef _LUNAIX_UHDR_USR_THREADS_H
+#define _LUNAIX_UHDR_USR_THREADS_H
 
 #include "types.h"
 
-struct uthread_param {
+struct uthread_param 
+{
     void* th_handler;
     void* arg1;
 };
 
-#endif /* __LUNAIX_USR_THREADS_H */
+#endif /* _LUNAIX_UHDR_USR_THREADS_H */
index 3dbddb528c7d6f3a53019644229e4db94ce4002e..8a3410a77ace2a490dc3cf70d77c3a181924b99a 100644 (file)
@@ -1,43 +1,19 @@
-#ifndef __LUNAIX_SYS_TYPES_H
-#define __LUNAIX_SYS_TYPES_H
-
-#undef NULL
-#define NULL (void*)0
-#define NULLPTR 0
-
-#define PEXITTERM 0x100
-#define PEXITSTOP 0x200
-#define PEXITSIG 0x400
-
-#define PEXITNUM(flag, code) (flag | (code & 0xff))
-
-#define WNOHANG 1
-#define WUNTRACED 2
-#define WEXITSTATUS(wstatus) ((wstatus & 0xff))
-#define WIFSTOPPED(wstatus) ((wstatus & PEXITSTOP))
-#define WIFEXITED(wstatus)                                                     \
-    ((wstatus & PEXITTERM) && ((char)WEXITSTATUS(wstatus) >= 0))
-
-#define WIFSIGNALED(wstatus) ((wstatus & PEXITSIG))
-
-typedef signed long ssize_t;
-
-typedef int pid_t;
-typedef int tid_t;
-typedef int uid_t;
-typedef int gid_t;
-
-typedef __SIZE_TYPE__ size_t;
-
-typedef __SIZE_TYPE__ off_t;
-
-typedef unsigned int ino_t;
-
-typedef struct dev_t
+#ifndef _LUNAIX_UHDR_SYS_TYPES_H
+#define _LUNAIX_UHDR_SYS_TYPES_H
+
+typedef int             __lunaix_pid_t;
+typedef int             __lunaix_tid_t;
+typedef int             __lunaix_uid_t;
+typedef int             __lunaix_gid_t;
+typedef unsigned long   __lunaix_size_t;
+typedef signed long     __lunaix_ssize_t;
+typedef unsigned int    __lunaix_ino_t;
+
+typedef struct
 {
     unsigned int meta;
     unsigned int unique;
     unsigned int index;
-} dev_t;
+} __lunaix_dev_t;
 
-#endif /* __LUNAIX_TYPES_H */
+#endif /* _LUNAIX_UHDR_TYPES_H */
diff --git a/lunaix-os/includes/usr/lunaix/wait.h b/lunaix-os/includes/usr/lunaix/wait.h
new file mode 100644 (file)
index 0000000..222923b
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef _LUNAIX_UHDR_WAIT_H
+#define _LUNAIX_UHDR_WAIT_H
+
+#define PEXITTERM   0x100
+#define PEXITSTOP   0x200
+#define PEXITSIG    0x400
+
+#define WNOHANG     1
+#define WUNTRACED   2
+
+#define PEXITNUM(flag, code)    (flag | (code & 0xff))
+#define WEXITSTATUS(wstatus)    ((wstatus & 0xff))
+#define WIFSTOPPED(wstatus)     ((wstatus & PEXITSTOP))
+#define WIFSIGNALED(wstatus)    ((wstatus & PEXITSIG))
+
+#define WIFEXITED(wstatus)                                                     \
+    ((wstatus & PEXITTERM) && ((char)WEXITSTATUS(wstatus) >= 0))
+
+#endif /* _LUNAIX_UHDR_WAIT_H */
index 969c8288b2f0b58b91d8c6183e16dc017f770284..f8a20a14932e8fb0929b299ebd91696680758c9b 100644 (file)
@@ -3,7 +3,7 @@
 #include <lunaix/fs/devfs.h>
 #include <lunaix/spike.h>
 
-#include <usr/lunaix/dirent_defs.h>
+#include <usr/lunaix/dirent.h>
 
 extern struct v_inode_ops devfs_inode_ops;
 extern struct v_file_ops devfs_file_ops;
index b022d425d7880cc863476bffd5090de804a64865..a4dcb10ba32b5a0a0906ecd3e8e305ecc1552ebe 100644 (file)
@@ -6,7 +6,7 @@
 
 #include <klibc/string.h>
 
-#include <usr/lunaix/dirent_defs.h>
+#include <usr/lunaix/dirent.h>
 
 extern struct cake_pile* drec_cache_pile;
 
index 246e90327cc3219af3f03d418c0fba366dc4aea6..df0942bdce955a26c5cfacaaf05f3db2dab9334d 100644 (file)
@@ -3,7 +3,7 @@
 #include <lunaix/process.h>
 #include <lunaix/spike.h>
 
-#include <usr/lunaix/fcntl_defs.h>
+#include <usr/lunaix/fcntl.h>
 
 #include <klibc/string.h>
 
index 2402cc57438e7b95a63944dd7dc7779656fe7928..8bcb64430d9b2eac65f8414c6075f7dbf76f988b 100644 (file)
@@ -55,7 +55,7 @@
 
 #include <lunaix/fs/twifs.h>
 
-#include <usr/lunaix/dirent_defs.h>
+#include <usr/lunaix/dirent.h>
 
 #define INODE_ACCESSED  0
 #define INODE_MODIFY    1
index 493d26cf3fe0876df64b1d5594f64fcfda67bd01..ac23bd6ffe0509d0e27e328b11eed9b1ee1a6ba7 100644 (file)
@@ -7,7 +7,7 @@
 
 #include <asm/mm_defs.h>
 
-#include <usr/lunaix/mann_flags.h>
+#include <usr/lunaix/mman.h>
 
 // any size beyond this is bullshit
 #define BS_SIZE (KERNEL_RESIDENT - USR_MMAP)
index 2015aec4ecbee608e0bffda7251078c19849f3ba..8ab3d65d6555204a31073de63958a3f135de9a72 100644 (file)
@@ -8,7 +8,7 @@
 #include <klibc/strfmt.h>
 #include <klibc/string.h>
 
-#include <usr/lunaix/dirent_defs.h>
+#include <usr/lunaix/dirent.h>
 
 #define COUNTER_MASK ((1 << 16) - 1)
 
index 804b8f82199a210660ba6ff5029073e710429b95..67a73f995835e71442612ce38f7f63fcc721f058 100644 (file)
@@ -1,11 +1,13 @@
 #include <errno.h>
 #include <fcntl.h>
-#include <lunaix/lunaix.h>
-#include <lunaix/mount.h>
+#include <sys/wait.h>
+#include <sys/mount.h>
 #include <termios.h>
 #include <stdio.h>
 #include <unistd.h>
 
+#include <sys/lunaix.h>
+
 #define must_mount(src, target, fs, opts)                                      \
     do {                                                                       \
         int err = 0;                                                           \
index 5007d28b2c612ed2637b3d66435c9c0112354e68..4c5bd3b10c27e37c1b18749f875c9cb6b32c5b77 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __LUNALIBC_SYS_DIRENT_H
 #define __LUNALIBC_SYS_DIRENT_H
 
-#include <lunaix/dirent_defs.h>
+#include <lunaix/dirent.h>
 
 typedef struct
 {
index b81830774fd260d218f5d5d32b9853e74b4c00ff..d527c9c5dece40969d8d7580b70f49be8857e13c 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef __LUNALIBC_SYS_FCNTL_H
 #define __LUNALIBC_SYS_FCNTL_H
 
-#include <lunaix/fcntl_defs.h>
-#include <lunaix/types.h>
+#include <lunaix/fcntl.h>
+#include <sys/types.h>
 
 extern int
 open(const char* path, int flags);
diff --git a/lunaix-os/usr/libc/includes/lunaix/syscall.h b/lunaix-os/usr/libc/includes/lunaix/syscall.h
deleted file mode 100644 (file)
index eb622e1..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef __LUNALIBC_OSDEPS_SYSCALL_H
-#define __LUNALIBC_OSDEPS_SYSCALL_H
-
-#include <lunaix/syscallid.h>
-
-extern unsigned long
-do_lunaix_syscall(unsigned long call_id, ...);
-
-#endif /* __LUNALIBC_OSDEPS_SYSCALL_H */
index 742e5e8a9860ce6f9b501e5dc810ec768794459a..fbf8c7c7d4aee3742536a0dc716b172bad63e7e1 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef __LUNALIBC_SYS_SIGNAL_H
 #define __LUNALIBC_SYS_SIGNAL_H
 
-#include <lunaix/signal_defs.h>
-#include <lunaix/types.h>
+#include <lunaix/signal.h>
+#include <sys/types.h>
 
 extern sighandler_t
 signal(int signum, sighandler_t handler);
similarity index 80%
rename from lunaix-os/usr/libc/includes/lunaix/ioctl.h
rename to lunaix-os/usr/libc/includes/sys/ioctl.h
index 34963ccf473ac4eafcddd8887876e4d1bf588d42..70a621deb7c1eeb004a29b6da7d9105ae0c8fccd 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __LUNALIBC_SYS_IOCTL_H
 #define __LUNALIBC_SYS_IOCTL_H
 
-#include <lunaix/ioctl_defs.h>
+#include <lunaix/ioctl.h>
 
 int ioctl(int fd, int req, ...);
 
similarity index 69%
rename from lunaix-os/usr/libc/includes/lunaix/lunaix.h
rename to lunaix-os/usr/libc/includes/sys/lunaix.h
index 678296989b28c201597bb72e3cc16580b55218ee..65004361cfb9ccfc7f3cdb0d49c32bee3f65ebc6 100644 (file)
@@ -1,18 +1,12 @@
 #ifndef __LUNALIBC_SYS_LUNAIX_H
 #define __LUNALIBC_SYS_LUNAIX_H
 
-#include <lunaix/types.h>
+#include <sys/types.h>
 #include <stddef.h>
 
 void
 yield();
 
-pid_t
-wait(int* status);
-
-pid_t
-waitpid(pid_t pid, int* status, int flags);
-
 void
 syslog(int level, const char* fmt, ...);
 
similarity index 80%
rename from lunaix-os/usr/libc/includes/lunaix/mann.h
rename to lunaix-os/usr/libc/includes/sys/mman.h
index 2e7f12faafad6816809fb29ad0c8cd75f876efe5..0ddf7652d87a30eae6588e2641009da02f385655 100644 (file)
@@ -2,8 +2,8 @@
 #define __LUNALIBC_SYS_MANN_H
 
 #include <stddef.h>
-#include <lunaix/mann_flags.h>
-#include <lunaix/types.h>
+#include <lunaix/mman.h>
+#include <sys/types.h>
 
 void* mmap(void* addr, size_t length, int proct, int flags, int fd, off_t offset);
 
similarity index 92%
rename from lunaix-os/usr/libc/includes/lunaix/mount.h
rename to lunaix-os/usr/libc/includes/sys/mount.h
index db90f107f8271734bf6e3249f652dfa384f8986a..156810af7c249af1c3afdc4d7035c92d4c44a54a 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __LUNALIBC_SYS_MOUNT_H
 #define __LUNALIBC_SYS_MOUNT_H
 
-#include <lunaix/types.h>
+#include <sys/types.h>
 
 extern int mount(const char* source, const char* target, const char* fstype, int flags);
 
diff --git a/lunaix-os/usr/libc/includes/sys/types.h b/lunaix-os/usr/libc/includes/sys/types.h
new file mode 100644 (file)
index 0000000..34c629d
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef __LUNAIX_TYPES_H
+#define __LUNAIX_TYPES_H
+
+#include <lunaix/types.h>
+
+typedef __lunaix_pid_t      pid_t;
+typedef __lunaix_tid_t      tid_t;
+typedef __lunaix_uid_t      uid_t;
+typedef __lunaix_gid_t      gid_t;
+typedef __lunaix_size_t     size_t;
+typedef __lunaix_ssize_t    ssize_t;
+typedef __lunaix_size_t     off_t;
+typedef __lunaix_ino_t      ino_t;
+
+typedef __lunaix_dev_t       dev_t;
+
+#endif /* __LUNAIX_TYPES_H */
diff --git a/lunaix-os/usr/libc/includes/sys/wait.h b/lunaix-os/usr/libc/includes/sys/wait.h
new file mode 100644 (file)
index 0000000..23f3447
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef __LUNAIX_WAIT_H
+#define __LUNAIX_WAIT_H
+
+#include <lunaix/wait.h>
+#include <sys/types.h>
+
+pid_t
+wait(int* status);
+
+pid_t
+waitpid(pid_t pid, int* status, int flags);
+
+#endif /* __LUNAIX_WAIT_H */
index d42b57545811cc43a1bccc821c393a22a4221b97..355197cec4f27f2e623e32a7f5e8f6f657b79b51 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __LUNALIBC_SYS_UNISTD_H
 #define __LUNALIBC_SYS_UNISTD_H
 
-#include <lunaix/types.h>
+#include <sys/types.h>
 #include <stddef.h>
 
 extern const char** environ;
index c9e16362cf225c8722fba5b35f6d36afea75c08c..ff261d07d63c1d86b3f94cf863ea5b8f46a91418 100644 (file)
@@ -1,5 +1,5 @@
 #include <syscall.h>
-#include <lunaix/dirent_defs.h>
+#include <lunaix/dirent.h>
 
 int
 sys_readdir(int fd, struct lx_dirent* dirent)
index 1eb5062bcba1bbe436efae6a09da86f73a34875b..3585a059cbb2057d40be874916cfc6f05a78415d 100644 (file)
@@ -1,5 +1,5 @@
 #include <syscall.h>
-#include <lunaix/ioctl.h>
+#include <sys/ioctl.h>
 #include <stdarg.h>
 
 int __attribute__((noinline))
index 7558ef704027b1903e8e83eef54a62db95a23f04..deba1017108750057c8724a03f3950bcd670d02c 100644 (file)
@@ -1,5 +1,5 @@
 #include <syscall.h>
-#include <lunaix/types.h>
+#include <sys/types.h>
 #include <stdio.h>
 
 void
index b7756fa2250a1e9a3159569a8783c30586c5c1e0..1481c122a4a5ec6bbf522e07813573833219e0fe 100644 (file)
@@ -1,6 +1,6 @@
 #include <syscall.h>
-#include <lunaix/mann.h>
-#include <lunaix/types.h>
+#include <sys/mman.h>
+#include <sys/types.h>
 
 void*
 mmap(void* addr, size_t length, int proct, int flags, int fd, off_t offset)
index 25b8101d7e1e8403a134b80c4b9b3a64e079a0d6..17a83fe0e07bae6660712acccea6e23f02b238da 100644 (file)
@@ -1,6 +1,6 @@
 #include <syscall.h>
-#include <lunaix/signal_defs.h>
-#include <lunaix/types.h>
+#include <lunaix/signal.h>
+#include <sys/types.h>
 
 int
 sigpending(sigset_t *set)
index e3cd16ca5c6bc2fc7df5209cb8b0ff742c3249e1..b6234ed51b460d8f5195eb0574f8c1d1103533d4 100644 (file)
@@ -1,5 +1,5 @@
 #include <syscall.h>
-#include <lunaix/types.h>
+#include <sys/types.h>
 
 pid_t
 fork()
index 52c97e4b609fd99b2f2fb952d9482201c3b57ebe..6c20ece800d4c68ca6f7be79cd9efad7008be917 100644 (file)
@@ -1,5 +1,5 @@
 #include <termios.h>
-#include <lunaix/ioctl.h>
+#include <sys/ioctl.h>
 
 int
 tcgetattr(int fd, struct termios* termios_p) 
index 748b8142e1717fd61231c1cd0ff871a6bad9709b..e9a5211afd700433fededd2a485c4bba4fc217db 100644 (file)
@@ -1,6 +1,6 @@
 #include <errno.h>
 #include <fcntl.h>
-#include <lunaix/lunaix.h>
+#include <sys/lunaix.h>
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
index 764404b0910a54fe50c33891b20967388c3de20e..c18b5edc0c435a690e5455bb9b4edf2ee1bce64f 100644 (file)
@@ -1,6 +1,6 @@
 #include <errno.h>
-#include <lunaix/ioctl.h>
-#include <lunaix/lunaix.h>
+#include <sys/ioctl.h>
+#include <sys/wait.h>
 #include <signal.h>
 #include <stdio.h>
 #include <string.h>
index 352d0de463db81619589c771408f86042586bac3..532b9b9f5343c5c17f89374d48d9cd01349b85f7 100644 (file)
@@ -1,4 +1,4 @@
-#include <lunaix/lunaix.h>
+#include <sys/wait.h>
 #include <signal.h>
 #include <stdio.h>
 #include <unistd.h>
index 1bd79f3a25a270720b0ff8b9a509f41819c3808c..3e782e96a428dd658304efaf6418c3c23f32661e 100644 (file)
@@ -2,6 +2,7 @@
 #include <fcntl.h>
 #include <stdio.h>
 #include <unistd.h>
+#include <sys/types.h>
 
 static char buf[256];
 
index ee33fe6f69710ee37c05b6635dd2cb880a6763da..c7d4c3882e97aa923e78a4234e3c802517f515be 100644 (file)
@@ -1,6 +1,6 @@
 #include <errno.h>
 #include <fcntl.h>
-#include <lunaix/lunaix.h>
+#include <sys/wait.h>
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>