libc/stdio: Add _unlocked() flavors of fflush, fputc, fputs, fread, fwrite.
[dragonfly.git] / sys / sys / lwp.h
1 #ifndef _SYS_LWP_H_
2 #define _SYS_LWP_H_
3
4 #include <sys/types.h>
5
6 /*
7  * Parameters for the creation of a new lwp.
8  */
9 struct lwp_params {
10         void (*lwp_func)(void *); /* Function to start execution */
11         void *lwp_arg;          /* Parameter to this function */
12         void *lwp_stack;        /* Stack address to use */
13         lwpid_t *lwp_tid1;      /* Address to copy out new tid */
14         lwpid_t *lwp_tid2;      /* Same */
15 };
16
17 #if !defined(_KERNEL) || defined(_KERNEL_VIRTUAL)
18
19 #include <sys/cpumask.h>
20
21 __BEGIN_DECLS
22
23 struct rtprio;
24
25 int     lwp_create(struct lwp_params *);
26 int     lwp_create2(struct lwp_params *, const cpumask_t *);
27 #ifndef _LWP_GETTID_DECLARED
28 lwpid_t lwp_gettid(void);
29 #define _LWP_GETTID_DECLARED
30 #endif
31 #ifndef _LWP_SETNAME_DECLARED
32 int     lwp_getname(lwpid_t, char *, size_t);
33 int     lwp_setname(lwpid_t, const char *);
34 #define _LWP_SETNAME_DECLARED
35 #endif
36 #ifndef _LWP_RTPRIO_DECLARED
37 int     lwp_rtprio(int, pid_t, lwpid_t, struct rtprio *);
38 #define _LWP_RTPRIO_DECLARED
39 #endif
40 int     lwp_setaffinity(pid_t, lwpid_t, const cpumask_t *);
41 int     lwp_getaffinity(pid_t, lwpid_t, cpumask_t *);
42 #ifndef _LWP_KILL_DECLARED
43 int     lwp_kill(pid_t, lwpid_t, int);
44 #define _LWP_KILL_DECLARED
45 #endif
46
47 __END_DECLS
48
49 #endif  /* !_KERNEL */
50
51 #endif  /* !_SYS_LWP_H_ */