Allowed functions:
| # | Function | Description | Prototype |
|---|---|---|---|
| 1 | memset() | Fills the first 'n' bytes of the memory area pointed to by 's' with the constant byte 'c'. | void *ft_memset(void *s, int c, size_t n) |
| 2 | printf() | The functions printf() writes output to stdout, the standard output stream. | int printf(const char *restrict format, ...) |
| 3 | malloc() | The malloc() function allocates size bytes and returns a pointer to the allocated memory. | void *malloc(size_t size) |
| 4 | free() | The free() function frees the memory space pointed to by ptr, which must have been returned by a previous call to malloc() | void free(void *ptr) |
| 5 | usleep() | The usleep() function suspends execution of the calling thread for (at least) usec microseconds. | int usleep(useconds_t usec) |
| 6 | gettimeofday() | The function gettimeofday() can get the time as well as a timezone. | int gettimeofday(struct timeval *restrict tv, struct timezone *restrict tz) |
| 7 | pthread_create() | The pthread_create() function starts a new thread in the calling process. The new thread starts execution by invoking start_routine() arg is passed as the sole argument of start_routine(). | int pthread_create(pthread_t *restrict thread, const pthread_attr_t *restrict attr, void *(*start_routine)(void *), void *restrict arg) |
| 8 | pthread_detach() | The pthread_detach() function marks the thread identified by thread as detached. When a detached thread terminates, its resources are automatically released back to the system without the need for another thread to join with the terminated thread. | int pthread_detach(pthread_t thread) |
| 9 | pthread_join() | The pthread_join() function waits for the thread specified by thread to terminate. If that thread has already terminated, then pthread_join() returns immediately. The thread pecified by thread must be joinable. | int pthread_join(pthread_t thread, void **retval) |
| 10 | pthread_mutex_init() | The pthread_mutex_init() initialize a mutex | int pthread_mutex_init(pthread_mutex_t *restrict mutex, const pthread_mutexattr_t *restrict attr) pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER |
| 11 | pthread_mutex_destroy() | The pthread_mutex_destroy() destroy a mutex | int pthread_mutex_destroy(pthread_mutex_t *mutex) |
| 12 | pthread_mutex_lock() | The mutex object referenced by mutex shall be locked by a call to pthread_mutex_lock() that returns zero or [EOWNERDEAD]. | int pthread_mutex_lock(pthread_mutex_t *mutex) |
| 13 | pthread_mutex_lock() | The mutex object referenced by mutex shall be unlocked by a call to pthread_mutex_unlock() that returns zero or [EOWNERDEAD]. | int pthread_mutex_lock(pthread_mutex_t *mutex) |