Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / libcfs / 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 #ifdef __KERNEL__
24 /*
25  * Portable API to access common characteristics of "current" UNIX process.
26  *
27  * Implemented in portals/include/libcfs/<os>/
28  */
29 uid_t  cfs_curproc_uid(void);
30 gid_t  cfs_curproc_gid(void);
31 uid_t  cfs_curproc_fsuid(void);
32 gid_t  cfs_curproc_fsgid(void);
33 pid_t  cfs_curproc_pid(void);
34 int    cfs_curproc_groups_nr(void);
35 int    cfs_curproc_is_in_groups(gid_t group);
36 void   cfs_curproc_groups_dump(gid_t *array, int size);
37 mode_t cfs_curproc_umask(void);
38 char  *cfs_curproc_comm(void);
39
40
41 /*
42  * Plus, platform-specific constant
43  *
44  * CFS_CURPROC_COMM_MAX,
45  *
46  * and opaque scalar type
47  *
48  * cfs_kernel_cap_t
49  */
50 cfs_kernel_cap_t cfs_curproc_cap_get(void);
51 void cfs_curproc_cap_set(cfs_kernel_cap_t cap);
52 #endif
53
54 /* __LIBCFS_CURPROC_H__ */
55 #endif
56 /*
57  * Local variables:
58  * c-indentation-style: "K&R"
59  * c-basic-offset: 8
60  * tab-width: 8
61  * fill-column: 80
62  * scroll-step: 1
63  * End:
64  */