]>
git.ipfire.org Git - thirdparty/bash.git/blob - lib/sh/zwrite.c
1 /* Copyright (C) 1999 Free Software Foundation, Inc.
3 This file is part of GNU Bash, the Bourne Again SHell.
5 Bash is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free
7 Software Foundation; either version 2, or (at your option) any later
10 Bash is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 You should have received a copy of the GNU General Public License along
16 with Bash; see the file COPYING. If not, write to the Free Software
17 Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
21 #include <sys/types.h>
23 #if defined (HAVE_UNISTD_H)
33 /* Write NB bytes from BUF to file descriptor FD, retrying the write if
34 it is interrupted. We retry three times if we get a zero-length
35 write. Any other signal causes this function to return prematurely. */
44 for (n
= nb
, nt
= 0;;)
46 i
= write (fd
, buf
, n
);
59 else if (errno
!= EINTR
)