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

LibC: Service entry API

This commit implements the getservent family of functions:
getservent()
setservent()
endservent()
getservbyname()
getservbyport()

for accessing the /etc/services file.

This commit has addressed the issues identified by utilizing more C++ structures,
addressing unchecked error possibilities, strncpy bounds checking, and other issues
found in the initial pull request
This commit is contained in:
Read H 2020-04-10 16:47:07 -04:00 committed by Andreas Kling
parent ce572c9cb5
commit 844e5faf84
2 changed files with 227 additions and 3 deletions

View file

@ -50,8 +50,11 @@ struct servent {
char* s_proto;
};
struct servent* getservent();
struct servent* getservbyname(const char* name, const char* protocol);
struct servent* getservbyport(int port, const char* protocol);
void setservent(int stay_open);
void endservent();
extern int h_errno;
#define HOST_NOT_FOUND 101