public inbox for cygwin-cvs@sourceware.org help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org> To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: syscalls.cc: drop masking macros for standard IO functions Date: Thu, 4 Aug 2022 18:33:40 +0000 (GMT) [thread overview] Message-ID: <20220804183340.EBAD33858407@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=7718cb70d48eec468a0b0cb815ed4f8461355eda commit 7718cb70d48eec468a0b0cb815ed4f8461355eda Author: Corinna Vinschen <corinna@vinschen.de> Date: Thu Aug 4 20:32:36 2022 +0200 Cygwin: syscalls.cc: drop masking macros for standard IO functions The actual reason for these wrappers are lost in time, there's no hint even in the pre-2000 ChangeLog files. Apparently they were masking the prototypes or, alternatively, macros from newlib to clash with the definitions in syscalls.cc. They are not needed anymore, so just drop them. This uncovered that the buffer pointer to pwrite is erronously non-const. Fix this on the way out. Signed-off-by: Corinna Vinschen <corinna@vinschen.de> Diff: --- winsup/cygwin/syscalls.cc | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 2c2bc4142..2a481b8e5 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -6,17 +6,6 @@ This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ -#define fstat __FOOfstat__ -#define lstat __FOOlstat__ -//#define stat __FOOstat__ -#define _close __FOO_close__ -#define _lseek __FOO_lseek__ -#define _open __FOO_open__ -#define _read __FOO_read__ -#define _write __FOO_write__ -#define pread __FOO_pread -#define pwrite __FOO_pwrite - #include "winsup.h" #include "miscfuncs.h" #include <sys/stat.h> @@ -37,12 +26,6 @@ details. */ #include <iptypes.h> #include "ntdll.h" -#undef fstat -#undef lstat -//#undef stat -#undef pread -#undef pwrite - #include <cygwin/version.h> #include "cygerrno.h" #include "perprocess.h" @@ -62,12 +45,6 @@ details. */ #include <cygwin/fs.h> /* needed for RENAME_NOREPLACE */ #include <sys/reent.h> /* needed for _fwalk_sglue() declaration */ -#undef _close -#undef _lseek -#undef _open -#undef _read -#undef _write - static int mknod_worker (path_conv &, mode_t, _major_t, _minor_t); /* Close all files and process any queued deletions. @@ -1412,7 +1389,7 @@ writev (const int fd, const struct iovec *const iov, const int iovcnt) } extern "C" ssize_t -pwrite (int fd, void *ptr, size_t len, off_t off) +pwrite (int fd, const void *ptr, size_t len, off_t off) { pthread_testcancel (); @@ -1426,7 +1403,7 @@ pwrite (int fd, void *ptr, size_t len, off_t off) res = -1; } else - res = cfd->pwrite (ptr, len, off); + res = cfd->pwrite (const_cast<void *> (ptr), len, off); syscall_printf ("%lR = pwrite(%d, %p, %d, %d)", res, fd, ptr, len, off); return res;
reply other threads:[~2022-08-04 18:33 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220804183340.EBAD33858407@sourceware.org \ --to=corinna@sourceware.org \ --cc=cygwin-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).