| Samsung Internal API reference 2.0

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

unistd.h
Go to the documentation of this file.
1
9 #ifndef __UNISTD_H__
10 #define __UNISTD_H__
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15
16 #include <core/lseek.h>
17 #include <core/stat.h>
18 #include <sys/types.h>
19 #include <sys/resource.h>
20
27 #define TEMP_FAILURE_RETRY(expression) ({ \
28 typeof (expression) _result; \
29 do { \
30 _result = (expression); \
31 } while (_result == ((typeof (expression)) -1) && errno == EINTR); \
32 _result; })
33
40 extern void _exit(int status) __attribute__ ((noreturn));
41
42 #ifndef __HIDE_INTERNAL_FUNCTIONS__
43
47 extern void _exit_thread(unsigned long status) __attribute__ ((noreturn));
48 #endif /* __HIDE_INTERNAL_FUNCTIONS__ */
49
63 extern int profil(unsigned short *buf, size_t bufsiz, size_t offset, unsigned int scale);
64
69 extern pid_t getpid(void);
70
75 extern pid_t gettid(void);
76
81 extern int getcpu(void);
82
88 extern int getcluster(void);
89
97 extern int rename(const char *pathname, const char *new_pathname);
98
105 extern int unlink(const char *pathname);
106
115 extern int ftruncate(int fd, int size);
116
123 extern int rmdir(char *dir_name);
124
135 extern int close(int fd);
136
148 extern ssize_t read(int fd, void *buf, size_t count);
149
161 extern ssize_t write(int fd, const void *buf, size_t count);
162
170 extern int fstat(int fd, struct stat *buf);
171
179 extern int stat(const char *pathname, struct stat *buf);
180
187 extern int fsync(int fd);
188
204 extern int lseek(int fd, int offset, int whence);
205
218 extern long sysconf(int name);
220 enum {
221 _SC_OPEN_MAX,
222 _SC_PAGESIZE,
223 _SC_PHYS_PAGES,
224 _SC_AVPHYS_PAGES,
225 _SC_NPROCESSORS_CONF,
226 _SC_NPROCESSORS_ONLN,
227 _SC_THREADS,
228 _SC_THREAD_KEYS_MAX,
229 _SC_THREAD_THREADS_MAX,
230 _SC_THREAD_STACK_MIN,
231 };
232
233 #ifdef USE_JEMALLOC
234 extern ssize_t __readlink_stub(const char *pathname, char *buf, size_t bufsiz);
235 extern int __fcntl_stub(int fd, int cmd, ...);
236 #endif
237
238 #ifdef __cplusplus
239 }
240 #endif
241
242 #endif /* !__UNISTD_H__ */
243
getcluster
int getcluster(void)
Return the cluster id on which current thread is performed.
types.h
Wrapper for kernel types.h header.
read
ssize_t read(int fd, void *buf, size_t count)
Attempt to read count bytes from the file associated with the open file descriptor, fd, into the buffer pointed to by buf.
_SC_NPROCESSORS_CONF
Definition: unistd.h:225
pid_t
int pid_t
Definition: types.h:21
getcpu
int getcpu(void)
Return the number of CPU on which current thread is performed.
fsync
int fsync(int fd)
Synchronize a file&#39;s in-core state with storage device.
write
ssize_t write(int fd, const void *buf, size_t count)
Attempt to write count bytes from buffer pointed to by buf to the file associated with the open file ...
rmdir
int rmdir(char *dir_name)
Remove a directory at file system.
gettid
pid_t gettid(void)
Return the thread ID of the calling thread.
profil
int profil(unsigned short *buf, size_t bufsiz, size_t offset, unsigned int scale)
Provide a means to find out in what areas your program spends most of its time. The argument buf poin...
fstat
int fstat(int fd, struct stat *buf)
Get status of a file with a descriptor fd.
_SC_OPEN_MAX
Definition: unistd.h:221
stat
int stat(const char *pathname, struct stat *buf)
Get status of a file pathname.
sysconf
long sysconf(int name)
Get configuration information at run time.
_SC_AVPHYS_PAGES
Definition: unistd.h:224
close
int close(int fd)
Deallocate the file descriptor indicated by fd. To deallocate means to make the file descriptor avail...
_exit
void _exit(int status)
Terminate the calling process "immediately". Any open file descriptors belonging to the process are c...
rename
int rename(const char *pathname, const char *new_pathname)
Rename file.
getpid
pid_t getpid(void)
Return the process ID of the calling process.
stat
Definition: stat.h:48
_SC_THREADS
Definition: unistd.h:227
_SC_THREAD_KEYS_MAX
Definition: unistd.h:228
_SC_NPROCESSORS_ONLN
Definition: unistd.h:226
_SC_PHYS_PAGES
Definition: unistd.h:223
_SC_THREAD_STACK_MIN
Definition: unistd.h:230
lseek
int lseek(int fd, int offset, int whence)
Reposition read/write file offset.
_SC_PAGESIZE
Definition: unistd.h:222
ssize_t
intptr_t ssize_t
Definition: types.h:17
unlink
int unlink(const char *pathname)
Remove a link to a file.
_SC_THREAD_THREADS_MAX
Definition: unistd.h:229
ftruncate
int ftruncate(int fd, int size)
Cause file referenced by fd to be truncated to a size of precisely length bytes.