1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:27:35 +00:00

LibC: Implement support for getspnam() and friends

This commit is contained in:
Gunnar Beutner 2021-05-01 11:43:38 +02:00 committed by Andreas Kling
parent ce77caf479
commit 302f9798ee
7 changed files with 356 additions and 61 deletions

View file

@ -0,0 +1,39 @@
/*
* Copyright (c) 2021, Gunnar Beutner <gbeutner@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <bits/FILE.h>
#include <sys/cdefs.h>
#include <sys/types.h>
__BEGIN_DECLS
struct spwd {
char* sp_namp;
char* sp_pwdp;
long int sp_lstchg;
long int sp_min;
long int sp_max;
long int sp_warn;
long int sp_inact;
long int sp_expire;
unsigned long int sp_flag;
};
struct spwd* getspent();
void setspent();
void endspent();
struct spwd* getspnam(const char* name);
int putspent(struct spwd* p, FILE* stream);
int getspent_r(struct spwd* spbuf, char* buf, size_t buflen, struct spwd** spbufp);
int getspnam_r(const char* name, struct spwd* spbuf, char* buf, size_t buflen, struct spwd** spbufp);
int fgetspent_r(FILE* fp, struct spwd* spbuf, char* buf, size_t buflen, struct spwd** spbufp);
int sgetspent_r(const char* s, struct spwd* spbuf, char* buf, size_t buflen, struct spwd** spbufp);
__END_DECLS