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

Function fd_mode_str

connectd/connectd.c:2178–2198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2176}
2177
2178static char *fd_mode_str(int fd)
2179{
2180 struct stat finfo;
2181 if (0 != fstat(fd, &finfo))
2182 return "invalid fd";
2183 if (S_ISBLK(finfo.st_mode))
2184 return "block special";
2185 if (S_ISCHR(finfo.st_mode))
2186 return "char special";
2187 if (S_ISDIR(finfo.st_mode))
2188 return "directory";
2189 if (S_ISFIFO(finfo.st_mode))
2190 return "fifo or socket";
2191 if (S_ISREG(finfo.st_mode))
2192 return "regular file";
2193 if (S_ISLNK(finfo.st_mode))
2194 return "symbolic link";
2195 if (S_ISSOCK(finfo.st_mode))
2196 return "socket";
2197 return "unknown";
2198}
2199
2200static void dev_report_fds(struct daemon *daemon, const u8 *msg)
2201{

Callers 1

dev_report_fdsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected