Lines Matching refs:fd
77 send_command(int fd, struct apm_command *cmd, struct apm_reply *reply)
82 if (send(fd, cmd, sizeof(*cmd), 0) == sizeof(*cmd)) {
83 if (recv(fd, reply, sizeof(*reply), 0) != sizeof(*reply)) {
95 do_zzz(int fd, enum apm_action action)
123 ret = send_command(fd, &command, &reply);
160 int ch, fd, rval;
252 fd = open_socket(sockname);
254 if (fd != -1) {
260 if (fd < 0)
263 return (do_zzz(fd, action));
265 if (fd < 0)
268 return (do_zzz(fd, HIBERNATE));
282 if (fd == -1)
291 if (fd == -1) {
293 fd = open(_PATH_APM_NORMAL, O_RDONLY);
294 if (ioctl(fd, APM_IOC_GETPOWER,
313 if (fd != -1 && (rval = send_command(fd, &command, &reply)) != 0)