Function: tramp-get-remote-pipe-buf

tramp-get-remote-pipe-buf is an autoloaded and byte-compiled function defined in tramp-sh.el.gz.

Signature

(tramp-get-remote-pipe-buf VEC)

Documentation

Return PIPE_BUF config from the remote side.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-sh.el.gz
;; The PIPE_BUF in POSIX [1] can be as low as 512 [2].  Here are the values
;; on various platforms:
;;   - 512 on macOS, FreeBSD, NetBSD, OpenBSD, MirBSD, native Windows.
;;   - 4 KiB on Linux, OSF/1, Cygwin, Haiku.
;;   - 5 KiB on Solaris.
;;   - 8 KiB on HP-UX, Plan9.
;;   - 10 KiB on IRIX.
;;   - 32 KiB on AIX, Minix.
;;   - `undefined' on QNX.
;; [1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html
;; [2] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html
;; See Bug#65324.
;;;###tramp-autoload
(defun tramp-get-remote-pipe-buf (vec)
  "Return PIPE_BUF config from the remote side."
  (with-tramp-connection-property vec "pipe-buf"
    (if-let* ((result
	       (tramp-send-command-and-read
		vec (format "getconf PIPE_BUF / 2>%s"
			    (tramp-get-remote-null-device vec))
		'noerror))
	      ((natnump result)))
	result 4096)))