public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* Fix sockatmark implementation
@ 2005-09-17 14:07 Andreas Jaeger
  2005-09-17 23:38 ` Ulrich Drepper
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Jaeger @ 2005-09-17 14:07 UTC (permalink / raw)
  To: Glibc hackers

[-- Attachment #1: Type: text/plain, Size: 1867 bytes --]


Sockatmark was not implemented correctly at all, the ioctl needs an
extra argument.  Ok to commit?

Andreas

2005-09-17  Andreas Jaeger  <aj@suse.de>

	[BZ #1010]
	* sysdeps/unix/sysv/linux/sockatmark.c: New file.

============================================================
Index: sysdeps/unix/sysv/linux/sockatmark.c
--- sysdeps/unix/sysv/linux/sockatmark.c	created
+++ sysdeps/unix/sysv/linux/sockatmark.c	2005-09-17 16:06:06.000000000 +0200	1.1
@@ -0,0 +1,33 @@
+/* Copyright (C) 2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+
+/* Determine wheter socket is at a out-of-band mark.  */
+int
+sockatmark (int fd)
+{
+  int arg, retval;
+
+  retval = INLINE_SYSCALL (ioctl, 3, fd, SIOCATMARK, &arg);
+  if (retval == -1)
+    return -1;
+  
+  return arg;
+}

-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Fix sockatmark implementation
  2005-09-17 14:07 Fix sockatmark implementation Andreas Jaeger
@ 2005-09-17 23:38 ` Ulrich Drepper
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2005-09-17 23:38 UTC (permalink / raw)
  To: Andreas Jaeger; +Cc: Glibc hackers

[-- Attachment #1: Type: text/plain, Size: 331 bytes --]

Andreas Jaeger wrote:
> Sockatmark was not implemented correctly at all, the ioctl needs an
> extra argument.  Ok to commit?

This use of ioctl() isn't Linux specific, I fixed the implementation.
No need to introduce a Linux version.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-09-17 23:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-17 14:07 Fix sockatmark implementation Andreas Jaeger
2005-09-17 23:38 ` Ulrich Drepper

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).