Whamcloud - gitweb
* Landed portals:b_port_step as follows...
[fs/lustre-release.git] / lnet / include / libcfs / curproc.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  * Lustre curproc API declaration
5  *
6  * Copyright (C) 2004 Cluster File Systems, Inc.
7  * Author: Nikita Danilov <nikita@clusterfs.com>
8  *
9  * This file is part of Lustre, http://www.lustre.org.
10  *
11  * Lustre is free software; you can redistribute it and/or modify it under the
12  * terms of version 2 of the GNU General Public License as published by the
13  * Free Software Foundation. Lustre is distributed in the hope that it will be
14  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
16  * Public License for more details. You should have received a copy of the GNU
17  * General Public License along with Lustre; if not, write to the Free
18  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  */
20 #ifndef __LIBCFS_CURPROC_H__
21 #define __LIBCFS_CURPROC_H__
22
23 /*
24  * Portable API to access common characteristics of "current" UNIX process.
25  *
26  * Implemented in portals/include/libcfs/<os>/
27  */
28 uid_t  cfs_curproc_uid(void);
29 gid_t  cfs_curproc_gid(void);
30 uid_t  cfs_curproc_fsuid(void);
31 gid_t  cfs_curproc_fsgid(void);
32 pid_t  cfs_curproc_pid(void);
33 int    cfs_curproc_groups_nr(void);
34 int    cfs_curproc_is_in_groups(gid_t group);
35 void   cfs_curproc_groups_dump(gid_t *array, int size);
36 mode_t cfs_curproc_umask(void);
37 char  *cfs_curproc_comm(void);
38
39
40 /*
41  * Plus, platform-specific constant
42  *
43  * CFS_CURPROC_COMM_MAX,
44  *
45  * and opaque scalar type
46  *
47  * cfs_kernel_cap_t
48  */
49 cfs_kernel_cap_t cfs_curproc_cap_get(void);
50 void cfs_curproc_cap_set(cfs_kernel_cap_t cap);
51
52 /* __LIBCFS_CURPROC_H__ */
53 #endif
54 /*
55  * Local variables:
56  * c-indentation-style: "K&R"
57  * c-basic-offset: 8
58  * tab-width: 8
59  * fill-column: 80
60  * scroll-step: 1
61  * End:
62  */