sockatmark(3) Library Functions Manual sockatmark(3) sockatmark - (libc -lc) #include int sockatmark(int sockfd); glibc ( feature_test_macros(7)): sockatmark(): _POSIX_C_SOURCE >= 200112L sockatmark() sockfd . 1 0. . sockatmark() 1 0 . -1 errno . EBADF sockfd . EINVAL sockfd sockatmark() . attributes(7). +------------+------------------------------------+--------------------+ || | | +------------+------------------------------------+--------------------+ |sockatmark()| | MT-Safe | +------------+------------------------------------+--------------------+ POSIX.1-2008. glibc 2.2.4. POSIX.1-2001. sockatmark() 1 MSG_OOB recv(2). . sockatmark() SIGURG. sockatmark() SIOCATMARK ioctl(2). glibc 2.4 sockatmark(). SIGURG () : char buf[BUF_LEN]; char oobdata; int atmark, s; for (;;) { atmark = sockatmark(sockfd); if (atmark == -1) { perror("sockatmark"); break; } if (atmark) break; s = read(sockfd, buf, BUF_LEN); if (s == -1) perror("read"); if (s <= 0) break; } if (atmark == 1) { if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) { perror("recv"); ... } } fcntl(2), recv(2), send(2), tcp(7) 3 . . : . 6.18 8 2026 sockatmark(3)