]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/mini-os.git/commitdiff
minios: Implement some extra lib functions for ocaml xenstored stubdom
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 19 May 2009 13:15:43 +0000 (14:15 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 19 May 2009 13:15:43 +0000 (14:15 +0100)
We could stub them out as unsupported, but we may as well implement
them as they are very simple.

Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
include/posix/unistd.h
lib/sys.c

index 51047825c56abf71f487089ac5662fcf48883ffc..e85592f31439e3edc31b4a260fa08858c47354fa 100644 (file)
@@ -3,8 +3,14 @@
 
 #include_next <unistd.h>
 
+uid_t getuid(void);
+uid_t geteuid(void);
+gid_t getgid(void);
+gid_t getegid(void);
+int gethostname(char *name, size_t namelen);
 size_t getpagesize(void);
 int ftruncate(int fd, off_t length);
 int lockf(int fd, int cmd, off_t len);
+int nice(int inc);
 
 #endif /* _POSIX_UNISTD_H */
index 876443cf19dfe89b1371ad0f553de96645456a8f..d0bc76a6595c50b6ca43b49e7db8914cb654d4da 100644 (file)
--- a/lib/sys.c
+++ b/lib/sys.c
@@ -1185,6 +1185,32 @@ int clock_gettime(clockid_t clk_id, struct timespec *tp)
     return 0;
 }
 
+uid_t getuid(void)
+{
+       return 0;
+}
+
+uid_t geteuid(void)
+{
+       return 0;
+}
+
+gid_t getgid(void)
+{
+       return 0;
+}
+
+gid_t getegid(void)
+{
+       return 0;
+}
+
+int gethostname(char *name, size_t namelen)
+{
+       strncpy(name, "mini-os", namelen);
+       return 0;
+}
+
 size_t getpagesize(void)
 {
     return PAGE_SIZE;
@@ -1255,6 +1281,12 @@ void sparse(unsigned long data, size_t size)
     do_map_zero(data, n);
 }
 
+int nice(int inc)
+{
+    printk("nice() stub called with inc=%d\n", inc);
+    return 0;
+}
+
 
 /* Not supported by FS yet.  */
 unsupported_function_crash(link);