1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-06 22:12:47 -05:00

Rename most of the platform source files.

This gets rid of all those annoying 'win', 'ux' and 'gtk' prefixes
which made filenames annoying to type and to tab-complete. Also, as
with my other recent renaming sprees, I've taken the opportunity to
expand and clarify some of the names so that they're not such cryptic
abbreviations.
This commit is contained in:
Simon Tatham
2021-04-23 06:19:05 +01:00
parent d9f217323e
commit f39c51f9a7
92 changed files with 127 additions and 124 deletions

32
unix/peerinfo.c Normal file
View File

@ -0,0 +1,32 @@
/*
* Unix: wrapper for getsockopt(SO_PEERCRED), conditionalised on
* appropriate autoconfery.
*/
#if HAVE_CMAKE_H
#include "cmake.h"
#endif
#if HAVE_SO_PEERCRED
#define _GNU_SOURCE
#include <features.h>
#endif
#include <sys/socket.h>
#include "putty.h"
bool so_peercred(int fd, int *pid, int *uid, int *gid)
{
#if HAVE_SO_PEERCRED
struct ucred cr;
socklen_t crlen = sizeof(cr);
if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &crlen) == 0) {
*pid = cr.pid;
*uid = cr.uid;
*gid = cr.gid;
return true;
}
#endif
return false;
}