MCPcopy Create free account
hub / github.com/ElementsProject/lightning / fd_mode_str

Function fd_mode_str

connectd/connectd.c:2226–2246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2224}
2225
2226static char *fd_mode_str(int fd)
2227{
2228 struct stat finfo;
2229 if (0 != fstat(fd, &finfo))
2230 return "invalid fd";
2231 if (S_ISBLK(finfo.st_mode))
2232 return "block special";
2233 if (S_ISCHR(finfo.st_mode))
2234 return "char special";
2235 if (S_ISDIR(finfo.st_mode))
2236 return "directory";
2237 if (S_ISFIFO(finfo.st_mode))
2238 return "fifo or socket";
2239 if (S_ISREG(finfo.st_mode))
2240 return "regular file";
2241 if (S_ISLNK(finfo.st_mode))
2242 return "symbolic link";
2243 if (S_ISSOCK(finfo.st_mode))
2244 return "socket";
2245 return "unknown";
2246}
2247
2248static void dev_report_fds(struct daemon *daemon, const u8 *msg)
2249{

Callers 1

dev_report_fdsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected