1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Update from Gnulib

This incorporates:
2019-06-04 copy-file-range: new module
2019-05-28 binaty-io: O_BINARY on consoles no longer fails
* doc/misc/texinfo.tex, lib/binary-io.c, lib/binary-io.h:
* lib/unistd.in.h, m4/unistd_h.m4: Copy from Gnulib.
* lib/gnulib.mk.in: Regenerate.
This commit is contained in:
Paul Eggert 2019-06-06 08:56:03 -07:00
parent a14eb43215
commit 111408a0e9
6 changed files with 42 additions and 21 deletions

View file

@ -53,25 +53,21 @@ __gl_setmode (int fd _GL_UNUSED, int mode _GL_UNUSED)
}
#endif
#if defined __DJGPP__ || defined __EMX__
extern int __gl_setmode_check (int);
#else
BINARY_IO_INLINE int
__gl_setmode_check (int fd _GL_UNUSED) { return 0; }
#endif
/* Set FD's mode to MODE, which should be either O_TEXT or O_BINARY.
Return the old mode if successful, -1 (setting errno) on failure.
Ordinarily this function would be called 'setmode', since that is
its name on MS-Windows, but it is called 'set_binary_mode' here
to avoid colliding with a BSD function of another name. */
#if defined __DJGPP__ || defined __EMX__
extern int set_binary_mode (int fd, int mode);
#else
BINARY_IO_INLINE int
set_binary_mode (int fd, int mode)
{
int r = __gl_setmode_check (fd);
return r != 0 ? r : __gl_setmode (fd, mode);
return __gl_setmode (fd, mode);
}
#endif
/* This macro is obsolescent. */
#define SET_BINARY(fd) ((void) set_binary_mode (fd, O_BINARY))