libspl: move cred definitions from zfs_context.h

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #17861
This commit is contained in:
Rob Norris 2025-08-25 22:00:24 +10:00 committed by Brian Behlendorf
parent 3823492ca1
commit 52cf8eac42
2 changed files with 18 additions and 15 deletions

View File

@ -177,15 +177,6 @@ extern "C" {
#endif /* DTRACE_PROBE4 */
#define DTRACE_PROBE4(a, b, c, d, e, f, g, h, i)
/*
* Credentials
*/
extern uid_t crgetuid(cred_t *cr);
extern uid_t crgetruid(cred_t *cr);
extern gid_t crgetgid(cred_t *cr);
extern int crgetngroups(cred_t *cr);
extern gid_t *crgetgroups(cred_t *cr);
/*
* Thread-specific data
*/
@ -371,12 +362,6 @@ typedef struct vsecattr {
#define CPU_SEQID ((uintptr_t)pthread_self() & (max_ncpus - 1))
#define CPU_SEQID_UNSTABLE CPU_SEQID
#define kcred NULL
#define CRED() NULL
#define crhold(cr) ((void)cr)
#define crfree(cr) ((void)cr)
#define ptob(x) ((x) * PAGESIZE)
#define NN_DIVISOR_1000 (1U << 0)

View File

@ -28,6 +28,24 @@
#ifndef _LIBSPL_SYS_CRED_H
#define _LIBSPL_SYS_CRED_H
#include <sys/stat.h>
/*
* Credentials
*/
typedef struct cred cred_t;
extern uid_t crgetuid(cred_t *cr);
extern uid_t crgetruid(cred_t *cr);
extern gid_t crgetgid(cred_t *cr);
extern int crgetngroups(cred_t *cr);
extern gid_t *crgetgroups(cred_t *cr);
#define kcred NULL
#define CRED() NULL
#define crhold(cr) ((void)cr)
#define crfree(cr) ((void)cr)
#endif