Lines Matching full:fd
48 long fd; in smh_open() local
74 fd = smh_trap(SYSOPEN, &open); in smh_open()
75 if (fd == -1) in smh_open()
76 printf("%s: ERROR fd %ld for file \'%s\'\n", __func__, fd, in smh_open()
79 return fd; in smh_open()
85 static long smh_read(long fd, void *memp, size_t len) in smh_read() argument
89 long fd; in smh_read() member
94 debug("%s: fd %ld, memp %p, len %zu\n", __func__, fd, memp, len); in smh_read()
96 read.fd = fd; in smh_read()
108 printf("%s: ERROR ret %ld, fd %ld, len %zu memp %p\n", in smh_read()
109 __func__, ret, fd, len, memp); in smh_read()
119 static long smh_close(long fd) in smh_close() argument
123 debug("%s: fd %ld\n", __func__, fd); in smh_close()
125 ret = smh_trap(SYSCLOSE, &fd); in smh_close()
127 printf("%s: ERROR fd %ld\n", __func__, fd); in smh_close()
135 static long smh_len_fd(long fd) in smh_len_fd() argument
139 debug("%s: fd %ld\n", __func__, fd); in smh_len_fd()
141 ret = smh_trap(SYSFLEN, &fd); in smh_len_fd()
143 printf("%s: ERROR ret %ld, fd %ld\n", __func__, ret, fd); in smh_len_fd()
151 long fd; in smh_load_file() local
155 fd = smh_open(name, "rb"); in smh_load_file()
156 if (fd == -1) in smh_load_file()
159 len = smh_len_fd(fd); in smh_load_file()
161 smh_close(fd); in smh_load_file()
165 ret = smh_read(fd, (void *)load_addr, len); in smh_load_file()
166 smh_close(fd); in smh_load_file()