public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Takashi Yano <takashi.yano@nifty.ne.jp>
To: cygwin-patches@cygwin.com
Cc: Takashi Yano <takashi.yano@nifty.ne.jp>
Subject: [PATCH] Cygwin: dsp: Fix a problem that fcntl() does not take effect.
Date: Thu, 19 Jan 2023 22:10:05 +0900	[thread overview]
Message-ID: <20230119131005.2012-1-takashi.yano@nifty.ne.jp> (raw)

Previously, fhandler_dev_dsp (OSS) has a problem that fcntl() does
not take effect at all. This patch fixes the issue.

Sighed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
---
 winsup/cygwin/fhandler/dsp.cc           | 12 ++++++++++++
 winsup/cygwin/local_includes/fhandler.h |  2 ++
 2 files changed, 14 insertions(+)

diff --git a/winsup/cygwin/fhandler/dsp.cc b/winsup/cygwin/fhandler/dsp.cc
index c37bedea5..8798cf876 100644
--- a/winsup/cygwin/fhandler/dsp.cc
+++ b/winsup/cygwin/fhandler/dsp.cc
@@ -1038,6 +1038,12 @@ fhandler_dev_dsp::ioctl (unsigned int cmd, void *buf)
   return base ()->_ioctl (cmd, buf);
 }
 
+int
+fhandler_dev_dsp::fcntl (int cmd, intptr_t arg)
+{
+  return base ()->_fcntl (cmd, arg);
+}
+
 void
 fhandler_dev_dsp::fixup_after_fork (HANDLE parent)
 {
@@ -1417,6 +1423,12 @@ fhandler_dev_dsp::_ioctl (unsigned int cmd, void *buf)
     }
 }
 
+int
+fhandler_dev_dsp::_fcntl (int cmd, intptr_t arg)
+{
+  return fhandler_base::fcntl(cmd, arg);
+}
+
 void
 fhandler_dev_dsp::_fixup_after_fork (HANDLE parent)
 { // called from new child process
diff --git a/winsup/cygwin/local_includes/fhandler.h b/winsup/cygwin/local_includes/fhandler.h
index bc02eae66..5fe979538 100644
--- a/winsup/cygwin/local_includes/fhandler.h
+++ b/winsup/cygwin/local_includes/fhandler.h
@@ -2766,6 +2766,7 @@ class fhandler_dev_dsp: public fhandler_base
   ssize_t write (const void *, size_t);
   void read (void *, size_t&);
   int ioctl (unsigned int, void *);
+  int fcntl (int cmd, intptr_t);
   int close ();
   void fixup_after_fork (HANDLE);
   void fixup_after_exec ();
@@ -2774,6 +2775,7 @@ class fhandler_dev_dsp: public fhandler_base
   ssize_t _write (const void *, size_t);
   void _read (void *, size_t&);
   int _ioctl (unsigned int, void *);
+  int _fcntl (int cmd, intptr_t);
   void _fixup_after_fork (HANDLE);
   void _fixup_after_exec ();
 
-- 
2.39.0


             reply	other threads:[~2023-01-19 13:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-19 13:10 Takashi Yano [this message]
2023-01-19 13:18 ` Takashi Yano

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=20230119131005.2012-1-takashi.yano@nifty.ne.jp \
    --to=takashi.yano@nifty.ne.jp \
    --cc=cygwin-patches@cygwin.com \
    /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: link
Be 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).