Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6069715ybi; Sun, 21 Jul 2019 08:34:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIQ6JDFEwiWZAldN7xcVQqjkQEr89GoYajksz2u3J0w8zE+Dr1+QoaDHQPNgks8+hTZhbY X-Received: by 2002:a65:534c:: with SMTP id w12mr67255772pgr.51.1563723251907; Sun, 21 Jul 2019 08:34:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563723251; cv=none; d=google.com; s=arc-20160816; b=kZ4OyCFPoXPWFHVMDc2ZaNjqNCYA++M8e3K0O10bUqcWZbNhNzYK88RS0WXnhC1mOj HosD9BeCYtRCHCvF24w7nImPsnBUqpp5R2evB2OWCjT4qbK95qjgn2ibnPMGDYL0/dEv pqyKNQT/gARl0AWc7stRo2D52gtNxlWAuTkTY6ZUHDKQHL6tZyac7NIclQAxxV1JsF/7 bzh+m5tsG1XAiGAKc0xhUqzist71IDjQkUBx7AN1uAeTJxQIpFb0kM1d1r+kRdaptlbE xZm6lVCAcGcEwXzYS5RSqV5NJo7Nl+NWQ+SS5IZEMj2+TSCkSuC/NwWTovgaDnvua6SH XD4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:subject:to:from :date; bh=4aUymSo5T2ufJ6INWK1iVn4Q+6JmxxGrwDkKgwIi9E8=; b=ZVnJX4LWXPEwAGQab0BWs9SaC/oTNWllj5KnnZJ66TlZuSE0Ot7WfX3WhS16ZInq9e 7FNRxSAG0wIaJyu+rh7Vy5UR/DN56Pwy+uXio1gm02UPeWjWkKgzUb7kz3oSbEYmgrMV t8bORF8jF4GrA1DLhX9Lmq7qiEdCIPQYs3q+sylWXex5tOmwO7k/DSIsBFjdEVAQD9/j ZyGJlkRi958H3HOcqQi2pF/pFCpord6FoHulS8PT2UZXCdLerE5ul6j1I+3TLIvIODcU JF6B88/exGdzifF9mFYKakDMALHMwnL92VCpURgWkuJJMAx+t1Rq7JHZ77hHYvdzI4G3 ZKIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a15si5769604pgw.246.2019.07.21.08.33.42; Sun, 21 Jul 2019 08:34:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726572AbfGUPcS (ORCPT + 99 others); Sun, 21 Jul 2019 11:32:18 -0400 Received: from netrider.rowland.org ([192.131.102.5]:40951 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726399AbfGUPcR (ORCPT ); Sun, 21 Jul 2019 11:32:17 -0400 Received: (qmail 16615 invoked by uid 500); 21 Jul 2019 11:32:16 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 21 Jul 2019 11:32:16 -0400 Date: Sun, 21 Jul 2019 11:32:16 -0400 (EDT) From: Alan Stern X-X-Sender: stern@netrider.rowland.org To: mtk.manpages@gmail.com, , Kernel development list Subject: Error (?) in man page for ppoll(2) Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Here are two extracts from the man page for ppoll(2) (from the man-pages 4.16 package; the 5.01 version is the same): Specifying a negative value in timeout means an infinite timeout. Other than the difference in the precision of the timeout argument, the following ppoll() call: ready = ppoll(&fds, nfds, tmo_p, &sigmask); is equivalent to atomically executing the following calls: sigset_t origmask; int timeout; timeout = (tmo_p == NULL) ? -1 : (tmo_p->tv_sec * 1000 + tmo_p->tv_nsec / 1000000); pthread_sigmask(SIG_SETMASK, &sigmask, &origmask); ready = poll(&fds, nfds, timeout); pthread_sigmask(SIG_SETMASK, &origmask, NULL); But if tmo_p->tv_sec is negative, the ppoll() call is not equivalent to the corresponding poll() call. The kernel rejects negative values of tv_sec with an EINVAL error; it does not interpret the value as meaning an infinite timeout. (Yes, the kernel interprets tmo_p == NULL as an infinite timeout, but the man page is still wrong for the case tmo_p->tv_sec < 0.) Suggested fix: Following the end of the second extract above, add: except that negative time values in tmo_p are not interpreted as an infinite timeout. Also, in the ERRORS section, change the text for EINVAL to: EINVAL The nfds value exceeds the RLIMIT_NOFILE value or *tmo_p contains an invalid (negative) time value. Alan Stern