Hi,
Can we use kernel provided implementation interfaces in User space programs?
For example
Code:
#include <sys/sem.h>
int semctl(int sem_id, int sem_num, int command, ...);
int semget(key_t key, int num_sems, int sem_flags);
int semop(int sem_id, struct sembuf *sem_ops, size_t num_sem_ops);
were meant for user application development.
Instead can we use the following interfaces of kernel impementation of semaphore
Code:
#include<asm/semaphore.h>
void sem_init(struct semaphore *sem, int val);
void down(struct semaphore *sem);
int down_interruptible(struct semaphore *sem);
int down_trylock(struct semaphore *sem);
void up(struct semaphore * sem);
in user application program.
please reply. I am newbie to linux kernel.