nckernel  0.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
pthread_fork.c File Reference
#include <sys/syscall.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <unistd.h>
#include <assert.h>
#include <pthread.h>
#include <errno.h>
#include <limits.h>
#include <fcntl.h>
#include <object.h>
#include <crt0.h>
#include <isr.h>
#include <list.h>
#include <thread.h>
#include <vfs.h>
#include <interrupt.h>
#include <x86_util.h>
#include <semaphore0.h>
#include <zone.h>
#include <page_frame.h>
#include <onetime_map.h>
#include <elf.h>
#include <segment.h>
#include <arch.h>
#include <debug.h>
#include <common.h>
#include <paging.h>
#include <x86.h>
Include dependency graph for pthread_fork.c:

Go to the source code of this file.

Functions

int execl (const char *path, const char *arg,...)
 
int execle (const char *path, const char *arg,...)
 
int execlp (const char *file, const char *arg,...)
 
int execv (const char *path, char *const argv[])
 
int execvp (const char *file, char *const argv[])
 
int execvpe (const char *file, const char *const argv[], char *const envp[])
 
pid_t fork (void)
 
int pthread_attr_destroy (pthread_attr_t *_attr)
 쓰레드 속성 객체를 소멸 시킨다. More...
 
int pthread_attr_getstack (pthread_attr_t *_attr, void **addr, size_t *size)
 쓰레드의 스택 정보를 얻어온다. More...
 
int pthread_attr_getstackaddr (pthread_attr_t *_attr, void **stackaddr)
 현재 쓰레드의 스택 주소를 가져온다. More...
 
int pthread_attr_getstacksize (pthread_attr_t *_attr, size_t *stacksize)
 현재 쓰레드의 스택 크기를 읽어 온다. More...
 
int pthread_attr_init (pthread_attr_t *_attr)
 쓰레드 속성 객체를 생성한다. More...
 
int pthread_attr_setstack (pthread_attr_t *_attr, void *addr, size_t size)
 쓰레드가 사용할 Attributes 에 스택 정보를 설정한다. More...
 
int pthread_attr_setstackaddr (pthread_attr_t *_attr, void *stackaddr)
 현재 쓰레드의 스택 주소를 설정하며, 해당 위치에서 부터 PTHREAD_STACK_MIN 보다 큰 영역이 할당 되어 있어야 한다. More...
 
int pthread_attr_setstacksize (pthread_attr_t *_attr, size_t stacksize)
 현재 쓰레드의 스택 크기를 결정한다. More...
 
int pthread_cancel (pthread_t thid)
 쓰레드 취소 요청을 보낸다 More...
 
int pthread_create (pthread_t *handle, const pthread_attr_t *_attr, void *(*func)(void *), void *arg)
 쓰레드를 생성한다. More...
 
int pthread_detach (pthread_t handle)
 쓰레드를 detach 시킨다. 쓰레드가 detach 되면 관련 Resource 들이 자동으로 시스템에 반환된다. More...
 
int pthread_equal (pthread_t t1, pthread_t t2)
 두 쓰레드가 같은 쓰레드 인지 비교한다. More...
 
int pthread_init (const pthread_attr_t *_attr)
 pthread 구현체를 초기화 하기 위한 portable 함수 표준 함수가 아니기 때문에, pthread0.h 로 뺐다. More...
 
int pthread_join (pthread_t handle, void **retval)
 주어진 쓰레드가 종료될 때 까지 기다린다. 해당 쓰레드의 자원을 모두 회수하고 정리한다. More...
 
pthread_t pthread_self (void)
 현재 쓰레드 포인터를 가져온다. More...
 
int pthread_yield (void)
 다른 쓰레드가 스케쥴링 될 수 있도록 양보한다. More...
 

Function Documentation

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

Definition at line 440 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 pthread_init ( const pthread_attr_t attr)

pthread 구현체를 초기화 하기 위한 portable 함수 표준 함수가 아니기 때문에, pthread0.h 로 뺐다.

Parameters
[in]attr쓰레드 속성 객체
Returns
int 성공시 0, 실패시 오류 코드

Definition at line 179 of file pthread_fork.c.

References thread::arch_data, dbg_printf(), EINVAL, ENOMEM, free(), thread_attr::is_first, malloc(), NULL, x86_arch_data::pma_pgd, x86_arch_data::rpgd, thread_create(), thread::user_data, and vm_rpgd().

Here is the call graph for this function: