SimpleOS

LXR

Navigation



Site hébergé par : enix

The LXR Cross Referencer for SOS

source navigation ]
diff markup ]
identifier search ]
general search ]
 
 
Article:1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 6.5 ] [ 7 ] [ 7.5 ] [ 8 ] [ 9 ] [ 9.5 ]

Diff markup

Differences between /userland/libc.h (Article 7.5) and /userland/libc.h (Article 7)


001 /* Copyright (C) 2005 David Decotigny             001 /* Copyright (C) 2005 David Decotigny
002    Copyright (C) 2003 Thomas Petazzoni            002    Copyright (C) 2003 Thomas Petazzoni
003                                                   003 
004    This program is free software; you can redi    004    This program is free software; you can redistribute it and/or
005    modify it under the terms of the GNU Genera    005    modify it under the terms of the GNU General Public License
006    as published by the Free Software Foundatio    006    as published by the Free Software Foundation; either version 2
007    of the License, or (at your option) any lat    007    of the License, or (at your option) any later version.
008                                                   008    
009    This program is distributed in the hope tha    009    This program is distributed in the hope that it will be useful,
010    but WITHOUT ANY WARRANTY; without even the     010    but WITHOUT ANY WARRANTY; without even the implied warranty of
011    MERCHANTABILITY or FITNESS FOR A PARTICULAR    011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012    GNU General Public License for more details    012    GNU General Public License for more details.
013                                                   013    
014    You should have received a copy of the GNU     014    You should have received a copy of the GNU General Public License
015    along with this program; if not, write to t    015    along with this program; if not, write to the Free Software
016    Foundation, Inc., 59 Temple Place - Suite 3    016    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
017    USA.                                           017    USA. 
018 */                                                018 */
019 #ifndef _SOS_USER_LIBC_H_                         019 #ifndef _SOS_USER_LIBC_H_
020 #define _SOS_USER_LIBC_H_                         020 #define _SOS_USER_LIBC_H_
021                                                   021 
022 #include <types.h>                                022 #include <types.h>
023                                                   023 
024 /**                                               024 /**
025  * @file libc.h                                   025  * @file libc.h
026  *                                                026  *
027  * The basic user C library for user programs     027  * The basic user C library for user programs
028  */                                               028  */
029                                                   029 
030 /**                                               030 /**
031  * The most important function of a C program     031  * The most important function of a C program ! ;)
032  */                                               032  */
033 void exit (int status) __attribute__((noreturn    033 void exit (int status) __attribute__((noreturn, alias("_sos_exit")));
034                                                   034 
035                                                << 
036 /**                                            << 
037  * Function to duplicate the current running p << 
038  */                                            << 
039 pid_t fork(void)  __attribute__ ((alias("_sos_ << 
040                                                << 
041                                                << 
042 /**                                            << 
043  * Function to re-initialize the address space << 
044  * with that of the program 'progname'         << 
045  */                                            << 
046 int exec(const char *progname) __attribute__ ( << 
047                                                << 
048                                                << 
049 /**                                            << 
050  * These flags (for mmap API) MUST be consiste << 
051  * paging.h and umem_vmm.h                     << 
052  */                                            << 
053 #define PROT_NONE  0                           << 
054 #define PROT_READ  (1<<0)                      << 
055 #define PROT_WRITE (1<<1)                      << 
056 #define PROT_EXEC  (1<<2) /* Not supported on  << 
057                                                << 
058 #define MAP_SHARED (1 << 0)                    << 
059 #define MAP_FIXED  (1 << 31)                   << 
060                                                << 
061 /**                                            << 
062  * Non standard version of mmap. Differences w << 
063  *  - the resource to map is given by its "pat << 
064  *  - the offset is a signed 64bits, and MUST  << 
065  *  - no errno support                         << 
066  */                                            << 
067 void * mmap(void *start, size_t length, int pr << 
068             const char *path, loff_t offset);  << 
069                                                << 
070                                                << 
071 /**                                            << 
072  * Unmap the given user address interval       << 
073  */                                            << 
074 int munmap(void * start, size_t length) __attr << 
075                                                << 
076                                                << 
077 /**                                            << 
078  * Change the access permissions of the given  << 
079  */                                            << 
080 int mprotect(const void *addr, size_t len, int << 
081                                                << 
082                                                << 
083                                                << 
084 /**                                            << 
085  * This flag tells mremap that the underlying  << 
086  */                                            << 
087 #define MREMAP_MAYMOVE (1 << 30)               << 
088                                                << 
089 /**                                            << 
090  * Grow/shrink the end of the given mapping    << 
091  */                                            << 
092 void * mremap(void * old_addr, size_t old_len, << 
093               size_t new_len,                  << 
094               unsigned long flags);            << 
095                                                << 
096                                                << 
097 /**                                            << 
098  * Standard heap management API                << 
099  */                                            << 
100                                                << 
101 /** @note MT UNSAFE */                         << 
102 int brk(void *end_data_seg);                   << 
103                                                << 
104 /** @note MT UNSAFE */                         << 
105 void *sbrk(ptrdiff_t increment);               << 
106                                                << 
107 /** @note MT UNSAFE */                         << 
108 void * calloc (size_t nmemb, size_t size);     << 
109                                                << 
110 /** @note MT UNSAFE */                         << 
111 void * malloc (size_t size);                   << 
112                                                << 
113                                                << 
114 #endif /* _SOS_USER_LIBC_H_ */                    035 #endif /* _SOS_USER_LIBC_H_ */
                                                      

source navigation ] diff markup ] identifier search ] general search ]