ia64/xen-unstable

changeset 19622:b4de3a393f21

minios: Implement some extra lib functions for ocaml xenstored stubdom

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>
author Keir Fraser <keir.fraser@citrix.com>
date Tue May 19 14:15:43 2009 +0100 (2009-05-19)
parents 49f2f2aa5f83
children e0221531d0e5
files extras/mini-os/include/posix/unistd.h extras/mini-os/lib/sys.c
line diff
     1.1 --- a/extras/mini-os/include/posix/unistd.h	Tue May 19 14:14:41 2009 +0100
     1.2 +++ b/extras/mini-os/include/posix/unistd.h	Tue May 19 14:15:43 2009 +0100
     1.3 @@ -3,8 +3,14 @@
     1.4  
     1.5  #include_next <unistd.h>
     1.6  
     1.7 +uid_t getuid(void);
     1.8 +uid_t geteuid(void);
     1.9 +gid_t getgid(void);
    1.10 +gid_t getegid(void);
    1.11 +int gethostname(char *name, size_t namelen);
    1.12  size_t getpagesize(void);
    1.13  int ftruncate(int fd, off_t length);
    1.14  int lockf(int fd, int cmd, off_t len);
    1.15 +int nice(int inc);
    1.16  
    1.17  #endif /* _POSIX_UNISTD_H */
     2.1 --- a/extras/mini-os/lib/sys.c	Tue May 19 14:14:41 2009 +0100
     2.2 +++ b/extras/mini-os/lib/sys.c	Tue May 19 14:15:43 2009 +0100
     2.3 @@ -1185,6 +1185,32 @@ int clock_gettime(clockid_t clk_id, stru
     2.4      return 0;
     2.5  }
     2.6  
     2.7 +uid_t getuid(void)
     2.8 +{
     2.9 +	return 0;
    2.10 +}
    2.11 +
    2.12 +uid_t geteuid(void)
    2.13 +{
    2.14 +	return 0;
    2.15 +}
    2.16 +
    2.17 +gid_t getgid(void)
    2.18 +{
    2.19 +	return 0;
    2.20 +}
    2.21 +
    2.22 +gid_t getegid(void)
    2.23 +{
    2.24 +	return 0;
    2.25 +}
    2.26 +
    2.27 +int gethostname(char *name, size_t namelen)
    2.28 +{
    2.29 +	strncpy(name, "mini-os", namelen);
    2.30 +	return 0;
    2.31 +}
    2.32 +
    2.33  size_t getpagesize(void)
    2.34  {
    2.35      return PAGE_SIZE;
    2.36 @@ -1255,6 +1281,12 @@ void sparse(unsigned long data, size_t s
    2.37      do_map_zero(data, n);
    2.38  }
    2.39  
    2.40 +int nice(int inc)
    2.41 +{
    2.42 +    printk("nice() stub called with inc=%d\n", inc);
    2.43 +    return 0;
    2.44 +}
    2.45 +
    2.46  
    2.47  /* Not supported by FS yet.  */
    2.48  unsupported_function_crash(link);