nckernel  0.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables

표준 기호 상수와 형을 선언한다. More...

Collaboration diagram for 표준 기호 상수와 형:

Macros

#define STDERR_FILENO   2 /* Standard error output */
 
#define STDIN_FILENO   0 /* Standard input */
 
#define STDOUT_FILENO   1 /* Standard output */
 

Functions

void _exit (int ret)
 
int access (const char *path, int mode)
 
unsigned alarm (unsigned sec)
 
int brk (void *ptr)
 
int chdir (const char *path)
 
int chown (const char *path, uid_t uid, gid_t gid)
 
int close (int fd)
 
size_t confstr (int name, char *buf, size_t len)
 
char * crypt (const char *key, const char *salt)
 
char * ctermid (char *s)
 
int dup (int fd)
 
int dup2 (int oldfd, int newfd)
 
void encrypt (char block[64], int edflat)
 
int execl (const char *path, const char *arg,...)
 
int execle (const char *path, const char *arg,...)
 
int execlp (const char *path, const char *arg,...)
 
int execv (const char *path, char *const argv[])
 
int execve (const char *path, const char *const argv[], char *const envp[])
 
int execvp (const char *path, char *const argv[])
 
int faccessat (int dirfd, const char *path, int mode, int flag)
 
int fchdir (int fd)
 
int fchown (int fd, uid_t uid, gid_t gid)
 
int fchownat (int dirfd, const char *path, uid_t uid, gid_t gid, int flag)
 
int fdatasync (int fd)
 
int fexecve (int fd, char *const argv[], char *const env[])
 
pid_t fork (void)
 
long fpathconf (int fd, int name)
 
int fsync (int fd)
 
int ftruncate (int fd, off_t off)
 
char * getcwd (char *buf, size_t size)
 
gid_t getegid (void)
 
uid_t geteuid (void)
 
gid_t getgid (void)
 
int getgroups (int size, gid_t list[])
 
long gethostid (void)
 
int gethostname (char *buf, size_t size)
 
char * getlogin (void)
 
int getlogin_r (char *buf, size_t size)
 
int getopt (int argc, char *const argv[], const char *optstring)
 
pid_t getpgid (pid_t pid)
 
pid_t getpgrp (void)
 
pid_t getpid (void)
 
pid_t getppid (void)
 
pid_t getsid (pid_t pid)
 
uid_t getuid (void)
 
int isatty (int fd)
 
int lchown (const char *path, uid_t owner, gid_t group)
 
int link (const char *oldpath, const char *newpath)
 
int linkat (int olddirfd, const char *oldname, int newdirfd, const char *newname, int flags)
 
int lockf (int fd, int cmd, off_t len)
 
off_t lseek (int fd, off_t offset, int whence)
 
int nice (int val)
 
long pathconf (const char *path, int name)
 
int pause (void)
 
int pipe (int fds[2])
 
ssize_t pread (int fd, void *buf, size_t size, off_t offset)
 
ssize_t pwrite (int fd, const void *buf, size_t size, off_t offset)
 
ssize_t read (int fd, void *buf, size_t size)
 
ssize_t readlink (const char *restrict path, char *restrict buf, size_t bufsz)
 
ssize_t readlinkat (int dirfd, const char *restrict path, char *restrict buf, size_t size)
 
int rmdir (const char *path)
 
void * sbrk (intptr_t increment)
 
int setegid (gid_t gid)
 
int seteuid (uid_t uid)
 
int setgid (gid_t gid)
 
int setpgid (pid_t pid, pid_t pgid)
 
pid_t setpgrp (void)
 
int setregid (gid_t rgid, gid_t egid)
 
int setreuid (uid_t ruid, uid_t euid)
 
pid_t setsid (void)
 
int setuid (uid_t euid)
 
unsigned sleep (unsigned secs)
 
void swab (const void *restrict from, void *restrict to, ssize_t size)
 
int symlink (const char *oldpath, const char *newpath)
 
int symlinkat (const char *oldpath, int newdirfd, const char *newpath)
 
void sync (void)
 
long sysconf (int name)
 
pid_t tcgetpgrp (int fd)
 
int tcsetpgrp (int fd, pid_t pid)
 
int truncate (const char *file, off_t offset)
 
char * ttyname (int fd)
 
int ttyname_r (int fd, char *buf, size_t size)
 
int unlink (const char *file)
 
int unlinkat (int dirfd, const char *file, int flags)
 
ssize_t write (int fd, const void *buf, size_t size)
 

Variables

char ** environ
 
char * optarg
 
int opterr
 
int optind
 
int optopt
 

Detailed Description

표준 기호 상수와 형을 선언한다.

Date
2011-8-26
Author
Sung-jae Park nices.nosp@m.j@ni.nosp@m.cesj..nosp@m.com

Macro Definition Documentation

#define STDERR_FILENO   2 /* Standard error output */

Definition at line 16 of file unistd.h.

Referenced by thread_get_stderr().

#define STDIN_FILENO   0 /* Standard input */

Definition at line 14 of file unistd.h.

Referenced by thread_get_stdin().

#define STDOUT_FILENO   1 /* Standard output */

Definition at line 15 of file unistd.h.

Referenced by thread_get_stdout().

Function Documentation

void _exit ( int  ret)
Parameters
[in]ret
Returns
See Also
int access ( const char *  path,
int  mode 
)
Parameters
[in]path
[in]mode
Returns
See Also
unsigned alarm ( unsigned  sec)
Parameters
[in]sec
Returns
See Also
int brk ( void *  ptr)
Parameters
[in]ptr
Returns
int
See Also
sbrk()

Definition at line 297 of file malloc.c.

References EBUSY, chunk::head, irq_local_restore(), irq_local_save(), list_entry, NEED_LOCK_TEST_BEGIN, NEED_LOCK_TEST_END, and chunk::size.

Here is the call graph for this function:

int chdir ( const char *  path)
Parameters
[in]path
Returns
See Also
int chown ( const char *  path,
uid_t  uid,
gid_t  gid 
)
Parameters
[in]path
[in]uid
[in]gid
Returns
See Also
int close ( int  fd)
Parameters
[in]fd
Returns
See Also

Definition at line 141 of file open.c.

References EFAULT, thread::file_ctx, file::object, object_destroy(), pthread_self(), and thread_file_ctx::table.

Referenced by create_fat_cache(), and destroy_fat_cache().

Here is the call graph for this function:

Here is the caller graph for this function:

size_t confstr ( int  name,
char *  buf,
size_t  len 
)
Parameters
[in]name
[in]buf
[in]len
Returns
See Also
char* crypt ( const char *  key,
const char *  salt 
)
Parameters
[in]key
[in]salt
Returns
See Also
char* ctermid ( char *  s)
Parameters
[in]s
Returns
See Also
int dup ( int  fd)
Parameters
[in]fd
Returns
See Also
int dup2 ( int  oldfd,
int  newfd 
)
Parameters
[in]oldfd
[in]newfd
Returns
See Also
void encrypt ( char  block[64],
int  edflat 
)
Parameters
[in]block
[in]edflat
Returns
See Also
int execl ( const char *  path,
const char *  arg,
  ... 
)
Parameters
[in]path
[in]arg
[in]...
Returns
See Also
Todo:
path 에 해당 하는 파일을 읽어서, 알맞은 binfmt 객체를 찾은 후, 실행 코드와 데이터들을 메모리에 로딩하고, 사용자 쓰레드용 스택 을 구성하고 thread->esp 를 갱신한 후 thread switching 이 발생 하도록 유도하여, user level thread 로 context switching 되도록 한다.

Definition at line 326 of file pthread_fork.c.

References assert, thread::attr, ENOSYS, thread_attr::is_first, pthread_self(), va_end, and va_start.

Here is the call graph for this function:

int execle ( const char *  path,
const char *  arg,
  ... 
)
Parameters
[in]path
[in]arg
[in]...
Returns
See Also
Todo:
path 에 해당 하는 파일을 읽어서, 알맞은 binfmt 객체를 찾은 후, 실행 코드와 데이터들을 메모리에 로딩하고, 사용자 쓰레드용 스택 을 구성하고 thread->esp 를 갱신한 후 thread switching 이 발생 하도록 유도하여, user level thread 로 context switching 되도록 한다.

Definition at line 354 of file pthread_fork.c.

References assert, thread::attr, ENOSYS, thread_attr::is_first, pthread_self(), va_end, and va_start.

Here is the call graph for this function:

int execlp ( const char *  path,
const char *  arg,
  ... 
)
Parameters
[in]path
[in]arg
[in]...
Returns
See Also
Todo:
path 에 해당 하는 파일을 읽어서, 알맞은 binfmt 객체를 찾은 후, 실행 코드와 데이터들을 메모리에 로딩하고, 사용자 쓰레드용 스택 을 구성하고 thread->esp 를 갱신한 후 thread switching 이 발생 하도록 유도하여, user level thread 로 context switching 되도록 한다.

Definition at line 382 of file pthread_fork.c.

References assert, thread::attr, ENOSYS, thread_attr::is_first, pthread_self(), va_end, and va_start.

Here is the call graph for this function:

int execv ( const char *  path,
char *const  argv[] 
)
Parameters
[in]path
[in]argv
Returns
See Also
Note
커널 쓰레드는 사용자 쓰레드로 변경 될 수 없다.
Todo:
path 에 해당 하는 파일을 읽어서, 알맞은 binfmt 객체를 찾은 후, 실행 코드와 데이터들을 메모리에 로딩하고, 사용자 쓰레드용 스택 을 구성하고 thread->esp 를 갱신한 후 thread switching 이 발생 하도록 유도하여, user level thread 로 context switching 되도록 한다.

Definition at line 410 of file pthread_fork.c.

References assert, thread::attr, ENOSYS, thread_attr::is_first, and pthread_self().

Here is the call graph for this function:

int execve ( const char *  path,
const char *const  argv[],
char *const  envp[] 
)
Parameters
[in]path
[in]argv
[in]envp
Returns
See Also
int execvp ( const char *  path,
char *const  argv[] 
)
Parameters
[in]path
[in]argv
Returns
See Also
Todo:
path 에 해당 하는 파일을 읽어서, 알맞은 binfmt 객체를 찾은 후, 실행 코드와 데이터들을 메모리에 로딩하고, 사용자 쓰레드용 스택 을 구성하고 thread->esp 를 갱신한 후 thread switching 이 발생 하도록 유도하여, user level thread 로 context switching 되도록 한다.

Definition at line 464 of file pthread_fork.c.

References assert, thread::attr, ENOSYS, thread_attr::is_first, and pthread_self().

Here is the call graph for this function:

int faccessat ( int  dirfd,
const char *  path,
int  mode,
int  flag 
)
Parameters
[in]dirfd
[in]path
[in]mode
[in]flag
Returns
See Also
int fchdir ( int  fd)
Parameters
[in]fd
Returns
See Also
int fchown ( int  fd,
uid_t  uid,
gid_t  gid 
)
Parameters
[in]fd
[in]uid
[in]gid
Returns
See Also
int fchownat ( int  dirfd,
const char *  path,
uid_t  uid,
gid_t  gid,
int  flag 
)
Parameters
[in]dirfd
[in]path
[in]uid
[in]gid
[in]flag
Returns
See Also
int fdatasync ( int  fd)
Parameters
[in]fd
Returns
See Also
int fexecve ( int  fd,
char *const  argv[],
char *const  env[] 
)
Parameters
[in]fd
[in]argv
[in]env
Returns
See Also
pid_t fork ( void  )
Returns
See Also
Note
커널 쓰레드를 fork 하는 것은 같은 page table 을 쓰는 상태에서 fork 하는 것으로, vfork 와 그 기능이 같다. 그러나, vfork 라는 concept 자체는 page table 을 모두 복사하는 (COW가 소개되기 이전) 방식이 사용될 때 소개된 것 으로 현재는 잘 쓰지 않는 방식이다. 굳이 nckernel 에서 kernel thread 를 fork 하지 않아도 된다. 이 함수는 nckernel 에서는 구현하지 않는다.

Definition at line 222 of file pthread_fork.c.

References ENOSYS.

long fpathconf ( int  fd,
int  name 
)
Parameters
[in]fd
[in]name
Returns
See Also
int fsync ( int  fd)
Parameters
[in]fd
Returns
See Also
int ftruncate ( int  fd,
off_t  off 
)
Parameters
[in]fd
[in]off
Returns
See Also
char* getcwd ( char *  buf,
size_t  size 
)
Parameters
[in]buf
[in]size
Returns
See Also
gid_t getegid ( void  )
Returns
See Also
uid_t geteuid ( void  )
Returns
See Also
gid_t getgid ( void  )
Returns
See Also
int getgroups ( int  size,
gid_t  list[] 
)
Parameters
[in]size
[in]list
Returns
See Also
long gethostid ( void  )
Returns
See Also
int gethostname ( char *  buf,
size_t  size 
)
Parameters
[in]buf
[in]size
Returns
See Also
char* getlogin ( void  )
Returns
See Also
int getlogin_r ( char *  buf,
size_t  size 
)
Parameters
[in]buf
[in]size
Returns
See Also
int getopt ( int  argc,
char *const  argv[],
const char *  optstring 
)
Parameters
[in]argc
[in]argv
[in]optstring
Returns
See Also
pid_t getpgid ( pid_t  pid)
Parameters
[in]pid
Returns
See Also
pid_t getpgrp ( void  )
Returns
See Also
pid_t getpid ( void  )
Returns
See Also
pid_t getppid ( void  )
Returns
See Also
pid_t getsid ( pid_t  pid)
Parameters
[in]pid
Returns
See Also
uid_t getuid ( void  )
Returns
See Also
int isatty ( int  fd)
Parameters
[in]fd
Returns
See Also
int lchown ( const char *  path,
uid_t  owner,
gid_t  group 
)
Parameters
[in]path
[in]owner
[in]group
Returns
See Also
int link ( const char *  oldpath,
const char *  newpath 
)
Parameters
[in]oldpath
[in]newpath
Returns
See Also
int linkat ( int  olddirfd,
const char *  oldname,
int  newdirfd,
const char *  newname,
int  flags 
)
Parameters
[in]olddirfd
[in]oldname
[in]newdirfd
[in]newname
[in]flags
Returns
See Also
int lockf ( int  fd,
int  cmd,
off_t  len 
)
Parameters
[in]fd
[in]cmd
[in]len
Returns
See Also
off_t lseek ( int  fd,
off_t  offset,
int  whence 
)
Parameters
[in]fd
[in]offset
[in]whence
Returns
See Also

Definition at line 57 of file open.c.

References file::ctx, EFAULT, EINVAL, EPERM, thread::file_ctx, ninfo_ops::lseek, entry::nctx, entry::ninfo, ninfo::nops, pthread_self(), and thread_file_ctx::table.

Referenced by update_fat_cache().

Here is the call graph for this function:

Here is the caller graph for this function:

int nice ( int  val)
Parameters
[in]val
Returns
See Also
long pathconf ( const char *  path,
int  name 
)
Parameters
[in]path
[in]name
Returns
See Also
int pause ( void  )
Returns
See Also
int pipe ( int  fds[2])
Parameters
[in]fds
Returns
See Also
ssize_t pread ( int  fd,
void *  buf,
size_t  size,
off_t  offset 
)
Parameters
[in]fd
[in]buf
[in]size
[in]offset
Returns
See Also
ssize_t pwrite ( int  fd,
const void *  buf,
size_t  size,
off_t  offset 
)
Parameters
[in]fd
[in]buf
[in]size
[in]offset
Returns
See Also
ssize_t read ( int  fd,
void *  buf,
size_t  size 
)
Parameters
[in]fd
[in]buf
[in]size
Returns
See Also

Definition at line 85 of file open.c.

References file::ctx, EFAULT, EINVAL, EPERM, thread::file_ctx, entry::nctx, entry::ninfo, ninfo::nops, pthread_self(), ninfo_ops::read, and thread_file_ctx::table.

Referenced by update_fat_cache().

Here is the call graph for this function:

Here is the caller graph for this function:

ssize_t readlink ( const char *restrict  path,
char *restrict  buf,
size_t  bufsz 
)
Parameters
[in]path
[in]buf
[in]bufsz
Returns
See Also
ssize_t readlinkat ( int  dirfd,
const char *restrict  path,
char *restrict  buf,
size_t  size 
)
Parameters
[in]dirfd
[in]path
[in]buf
[in]size
Returns
See Also
int rmdir ( const char *  path)
Parameters
[in]path
Returns
See Also
void* sbrk ( intptr_t  increment)
Parameters
[in]increment
Returns
void*
See Also
brk()

Definition at line 350 of file malloc.c.

References chunk::head, irq_local_restore(), irq_local_save(), list_entry, NEED_LOCK_TEST_BEGIN, NEED_LOCK_TEST_END, NULL, and chunk::size.

Referenced by malloc(), and posix_memalign().

Here is the call graph for this function:

Here is the caller graph for this function:

int setegid ( gid_t  gid)
Parameters
[in]gid
Returns
See Also
int seteuid ( uid_t  uid)
Parameters
[in]uid
Returns
See Also
int setgid ( gid_t  gid)
Parameters
[in]gid
Returns
See Also
int setpgid ( pid_t  pid,
pid_t  pgid 
)
Parameters
[in]pid
[in]pgid
Returns
See Also
pid_t setpgrp ( void  )
Returns
pid_t
See Also
int setregid ( gid_t  rgid,
gid_t  egid 
)
Parameters
[in]rgid
[in]egid
Returns
See Also
int setreuid ( uid_t  ruid,
uid_t  euid 
)
Parameters
[in]ruid
[in]euid
Returns
See Also
pid_t setsid ( void  )
Returns
pid_t
See Also
int setuid ( uid_t  euid)
Parameters
[in]euid
Returns
See Also
unsigned sleep ( unsigned  secs)
Parameters
[in]secs
Returns
See Also
void swab ( const void *restrict  from,
void *restrict  to,
ssize_t  size 
)
Parameters
[in]from
[in]to
[in]size
Returns
See Also
int symlink ( const char *  oldpath,
const char *  newpath 
)
Parameters
[in]oldpath
[in]newpath
Returns
See Also
int symlinkat ( const char *  oldpath,
int  newdirfd,
const char *  newpath 
)
Parameters
[in]oldpath
[in]newdirfd
[in]newpath
Returns
See Also
void sync ( void  )
Returns
void
See Also
long sysconf ( int  name)
Parameters
[in]name
Returns
See Also

Definition at line 8 of file sysconf.c.

References _SC_PAGESIZE, and PAGESIZE.

Referenced by free(), initm_alloc(), initm_free(), initm_init(), malloc(), onetime_map_init(), onetime_unmap(), page_allocator_get_region(), page_allocator_info_size(), page_allocator_init(), page_fault_handler(), pthread_self(), valloc(), vm_init(), and vm_init_done().

Here is the caller graph for this function:

pid_t tcgetpgrp ( int  fd)
Parameters
[in]fd
Returns
See Also
int tcsetpgrp ( int  fd,
pid_t  pid 
)
Parameters
[in]fd
[in]pid
Returns
See Also
int truncate ( const char *  file,
off_t  offset 
)
Parameters
[in]file
[in]offset
Returns
See Also
char* ttyname ( int  fd)
Parameters
[in]fd
Returns
See Also
int ttyname_r ( int  fd,
char *  buf,
size_t  size 
)
Parameters
[in]fd
[in]buf
[in]size
Returns
See Also
int unlink ( const char *  file)
Parameters
[in]file
Returns
See Also
int unlinkat ( int  dirfd,
const char *  file,
int  flags 
)
Parameters
[in]dirfd
[in]file
[in]flags
Returns
See Also
ssize_t write ( int  fd,
const void *  buf,
size_t  size 
)
Parameters
[in]fd
[in]buf
[in]size
Returns
See Also

Definition at line 113 of file open.c.

References file::ctx, EFAULT, EINVAL, EPERM, thread::file_ctx, entry::nctx, entry::ninfo, ninfo::nops, pthread_self(), thread_file_ctx::table, and ninfo_ops::write.

Referenced by fflush(), and fputc().

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

char** environ

Definition at line 11 of file stdlib.c.

Referenced by getenv().

char* optarg
int opterr
int optind
int optopt