JM Project

JM プロジェクトは、主に Linux 関連のマニュアルページの日本語ページを翻訳・公開しています。

Linux マニュアル 一覧

全文・高度検索

per page, with , order by , clip by
Results of 1 - 10 of about 13 for nread (0.005 sec.)
Man page of GETDENTS 11472
GETDENTS Section: Linux Programmer's Manual (2) Updated: 2020-11-01 Index JM Home Page 名前 getdents, getdents64 - ディレクトリエントリーを取得する 書式 long getdents(unsigned int fd , struct linux_dirent * dirp , unsigned int count ); #def ... ある。 以下は、このプログラムを ext2 ディレクトリで実行した際に得られる 出力の例である。 $ ./a.out /testfs/ --------------- nread=120 --------------- inode# file type d_reclen d_off d_name 2 directory 16 12 . 2 directory 16 24 .. 11 directory 24 44 los ... _t d_off; unsigned short d_reclen; char d_name[]; }; #define BUF_SIZE 1024 int main(int argc, char *argv[]) { int fd; long nread; char buf[BUF_SIZE]; struct linux_dirent *d; char d_type; fd = open(argc > 1 ? argv[1] : ".", O_RDONLY | O_DIRECTORY); if ... (fd == -1) handle_error("open"); for (;;) { nread = syscall(SYS_getdents, fd, buf, BUF_SIZE); if (nread == -1) handle_error("getdents"); if (nread == 0) break; printf("---- ...
https://man.mtool.work/man/20260915/man2/getdents.2.html
Man page of GETDENTS 11472
GETDENTS Section: Linux Programmer's Manual (2) Updated: 2020-11-01 Index JM Home Page 名前 getdents, getdents64 - ディレクトリエントリーを取得する 書式 long getdents(unsigned int fd , struct linux_dirent * dirp , unsigned int count ); #def ... ある。 以下は、このプログラムを ext2 ディレクトリで実行した際に得られる 出力の例である。 $ ./a.out /testfs/ --------------- nread=120 --------------- inode# file type d_reclen d_off d_name 2 directory 16 12 . 2 directory 16 24 .. 11 directory 24 44 los ... _t d_off; unsigned short d_reclen; char d_name[]; }; #define BUF_SIZE 1024 int main(int argc, char *argv[]) { int fd; long nread; char buf[BUF_SIZE]; struct linux_dirent *d; char d_type; fd = open(argc > 1 ? argv[1] : ".", O_RDONLY | O_DIRECTORY); if ... (fd == -1) handle_error("open"); for (;;) { nread = syscall(SYS_getdents, fd, buf, BUF_SIZE); if (nread == -1) handle_error("getdents"); if (nread == 0) break; printf("---- ...
https://man.mtool.work/man/20260915/man2/getdents64.2.html
Man page of GETADDRINFO 9730
GETADDRINFO Section: Linux Programmer's Manual (3) Updated: 2020-11-01 Index JM Home Page 名前 getaddrinfo, freeaddrinfo, gai_strerror - ネットワークのアドレスとサービスを変換する 書式 #include < sys/types.h > #include < sys/socket.h > #inc ... rinfo hints; struct addrinfo *result, *rp; int sfd, s; struct sockaddr_storage peer_addr; socklen_t peer_addr_len; ssize_t nread; char buf[BUF_SIZE]; if (argc != 2) { fprintf(stderr, "Usage: %s port\n", argv[0]); exit(EXIT_FAILURE); } memset(&hints, 0 ... n"); exit(EXIT_FAILURE); } /* Read datagrams and echo them back to sender */ for (;;) { peer_addr_len = sizeof(peer_addr); nread = recvfrom(sfd, buf, BUF_SIZE, 0, (struct sockaddr *) &peer_addr, &peer_addr_len); if (nread == -1) continue; /* Ignore fa ... er_addr_len, host, NI_MAXHOST, service, NI_MAXSERV, NI_NUMERICSERV); if (s == 0) printf("Received %zd bytes from %s:%s\n", nread, host, service); else fprintf(stderr, "getnameinfo: %s\n", gai_strerror(s)); if (sendto(sfd, buf, nread, 0, (struct sockad ...
https://man.mtool.work/man/20260915/man3/freeaddrinfo.3.html
Man page of GETADDRINFO 9730
GETADDRINFO Section: Linux Programmer's Manual (3) Updated: 2020-11-01 Index JM Home Page 名前 getaddrinfo, freeaddrinfo, gai_strerror - ネットワークのアドレスとサービスを変換する 書式 #include < sys/types.h > #include < sys/socket.h > #inc ... rinfo hints; struct addrinfo *result, *rp; int sfd, s; struct sockaddr_storage peer_addr; socklen_t peer_addr_len; ssize_t nread; char buf[BUF_SIZE]; if (argc != 2) { fprintf(stderr, "Usage: %s port\n", argv[0]); exit(EXIT_FAILURE); } memset(&hints, 0 ... n"); exit(EXIT_FAILURE); } /* Read datagrams and echo them back to sender */ for (;;) { peer_addr_len = sizeof(peer_addr); nread = recvfrom(sfd, buf, BUF_SIZE, 0, (struct sockaddr *) &peer_addr, &peer_addr_len); if (nread == -1) continue; /* Ignore fa ... er_addr_len, host, NI_MAXHOST, service, NI_MAXSERV, NI_NUMERICSERV); if (s == 0) printf("Received %zd bytes from %s:%s\n", nread, host, service); else fprintf(stderr, "getnameinfo: %s\n", gai_strerror(s)); if (sendto(sfd, buf, nread, 0, (struct sockad ...
https://man.mtool.work/man/20260915/man3/gai_strerror.3.html
Man page of GETADDRINFO 9730
GETADDRINFO Section: Linux Programmer's Manual (3) Updated: 2020-11-01 Index JM Home Page 名前 getaddrinfo, freeaddrinfo, gai_strerror - ネットワークのアドレスとサービスを変換する 書式 #include < sys/types.h > #include < sys/socket.h > #inc ... rinfo hints; struct addrinfo *result, *rp; int sfd, s; struct sockaddr_storage peer_addr; socklen_t peer_addr_len; ssize_t nread; char buf[BUF_SIZE]; if (argc != 2) { fprintf(stderr, "Usage: %s port\n", argv[0]); exit(EXIT_FAILURE); } memset(&hints, 0 ... n"); exit(EXIT_FAILURE); } /* Read datagrams and echo them back to sender */ for (;;) { peer_addr_len = sizeof(peer_addr); nread = recvfrom(sfd, buf, BUF_SIZE, 0, (struct sockaddr *) &peer_addr, &peer_addr_len); if (nread == -1) continue; /* Ignore fa ... er_addr_len, host, NI_MAXHOST, service, NI_MAXSERV, NI_NUMERICSERV); if (s == 0) printf("Received %zd bytes from %s:%s\n", nread, host, service); else fprintf(stderr, "getnameinfo: %s\n", gai_strerror(s)); if (sendto(sfd, buf, nread, 0, (struct sockad ...
https://man.mtool.work/man/20260915/man3/getaddrinfo.3.html
Man page of OPEN_BY_HANDLE_AT 9167
OPEN_BY_HANDLE_AT Section: Linux Programmer's Manual (2) Updated: 2020-11-01 Index JM Home Page 名前 name_to_handle_at, open_by_handle_at - パス名に対するハンドルの取得とハンドルによるファイルのオープン 書式 #define _GNU_SOURCE /* feature_t ... ./t_open_by_handle_at < fh open_by_handle_at: Operation not permitted $ sudo ./t_open_by_handle_at < fh # Need CAP_SYS_ADMIN Read 31 bytes $ rm cecilia.txt ここで、 ファイルを削除し (すぐに) 再作成する。 同じ内容で (運がよければ) 同じ inode になる。 こ ... pen_mount_path_by_id(int mount_id) { char *linep; size_t lsize; char mount_path[PATH_MAX]; int mi_mount_id, found; ssize_t nread; FILE *fp; fp = fopen("/proc/self/mountinfo", "r"); if (fp == NULL) errExit("fopen"); found = 0; linep = NULL; while (!fou ... nd) { nread = getline(&linep, &lsize, fp); if (nread == -1) break; nread = sscanf(linep, "%d %*d %*s %*s %s", &mi_mount_id, mount_path ...
https://man.mtool.work/man/20260915/man2/name_to_handle_at.2.html
Man page of OPEN_BY_HANDLE_AT 9167
OPEN_BY_HANDLE_AT Section: Linux Programmer's Manual (2) Updated: 2020-11-01 Index JM Home Page 名前 name_to_handle_at, open_by_handle_at - パス名に対するハンドルの取得とハンドルによるファイルのオープン 書式 #define _GNU_SOURCE /* feature_t ... ./t_open_by_handle_at < fh open_by_handle_at: Operation not permitted $ sudo ./t_open_by_handle_at < fh # Need CAP_SYS_ADMIN Read 31 bytes $ rm cecilia.txt ここで、 ファイルを削除し (すぐに) 再作成する。 同じ内容で (運がよければ) 同じ inode になる。 こ ... pen_mount_path_by_id(int mount_id) { char *linep; size_t lsize; char mount_path[PATH_MAX]; int mi_mount_id, found; ssize_t nread; FILE *fp; fp = fopen("/proc/self/mountinfo", "r"); if (fp == NULL) errExit("fopen"); found = 0; linep = NULL; while (!fou ... nd) { nread = getline(&linep, &lsize, fp); if (nread == -1) break; nread = sscanf(linep, "%d %*d %*s %*s %s", &mi_mount_id, mount_path ...
https://man.mtool.work/man/20260915/man2/open_by_handle_at.2.html
Man page of GETLINE 8973
GETLINE Section: Linux Programmer's Manual (3) Updated: 2020-11-01 Index JM Home Page 名前 getline, getdelim - 区切り文字までの文字列入力を読み込む 書式 #include < stdio.h > ssize_t getline(char ** lineptr , size_t * n , FILE * stream ); ss ... tdio.h > #include < stdlib.h > int main(int argc, char *argv[]) { FILE *stream; char *line = NULL; size_t len = 0; ssize_t nread; if (argc != 2) { fprintf(stderr, "Usage: %s <file>\n", argv[0]); exit(EXIT_FAILURE); } stream = fopen(argv[1], "r"); if ( ... stream == NULL) { perror("fopen"); exit(EXIT_FAILURE); } while ((nread = getline(&line, &len, stream)) != -1) { printf("Retrieved line of length %zd:\n", nread); fwrite(line, nread, 1, stdout); ...
https://man.mtool.work/man/20260915/man3/getdelim.3.html
Man page of GETLINE 8973
GETLINE Section: Linux Programmer's Manual (3) Updated: 2020-11-01 Index JM Home Page 名前 getline, getdelim - 区切り文字までの文字列入力を読み込む 書式 #include < stdio.h > ssize_t getline(char ** lineptr , size_t * n , FILE * stream ); ss ... tdio.h > #include < stdlib.h > int main(int argc, char *argv[]) { FILE *stream; char *line = NULL; size_t len = 0; ssize_t nread; if (argc != 2) { fprintf(stderr, "Usage: %s <file>\n", argv[0]); exit(EXIT_FAILURE); } stream = fopen(argv[1], "r"); if ( ... stream == NULL) { perror("fopen"); exit(EXIT_FAILURE); } while ((nread = getline(&line, &len, stream)) != -1) { printf("Retrieved line of length %zd:\n", nread); fwrite(line, nread, 1, stdout); ...
https://man.mtool.work/man/20260915/man3/getline.3.html
Man page of FOPENCOOKIE 7038
FOPENCOOKIE Section: Linux Programmer's Manual (3) Updated: 2020-11-01 Index JM Home Page 名前 fopencookie - 独自のストリームをオープンする 書式 #define _GNU_SOURCE /* feature_test_macros (7) 参照 */ #include < stdio.h > FILE *fopencookie(v ... rite = memfile_write, .seek = memfile_seek, .close = memfile_close }; FILE *stream; struct memfile_cookie mycookie; size_t nread; char buf[1000]; /* Set up the cookie before calling fopencookie() */ mycookie.buf = malloc(INIT_BUF_SIZE); if (mycookie.b ... , until EOF */ for (long p = 0; ; p += 5) { if (fseek(stream, p, SEEK_SET) == -1) { perror("fseek"); exit(EXIT_FAILURE); } nread = fread(buf, 1, 2, stream); if (nread == 0) { if (ferror(stream) != 0) { fprintf(stderr, "fread failed\n"); exit(EXIT_FAIL ... URE); } printf("Reached end of file\n"); break; } printf("/%.*s/\n", (int) nread, buf); } exit(EXIT_SUCCESS); } 関連項目 fclose (3), fmemopen (3), fopen (3), fseek (3) この文書について この man ページは ...
https://man.mtool.work/man/20260915/man3/fopencookie.3.html
PREV 1 2 NEXT

リンク

日本語の文書やマニュアルを配布している個人/プロジェクトへのリンクです。