mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Isaac Dunham <idunham@lavabit.com>
To: musl@lists.openwall.com
Subject: [1/3] _BSD_SOURCE for stdio.h
Date: Thu, 19 Apr 2012 14:01:49 -0700	[thread overview]
Message-ID: <20120419140149.3ff93608@newbook> (raw)
In-Reply-To: <20120419135245.6f617c6c@newbook>

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

This is compatible with NetBSD's _NETBSD_SOURCE, but is more
complete than glibc's _BSD_SOURCE.

Isaac Dunham

[-- Attachment #2: stdio.dif --]
[-- Type: application/octet-stream, Size: 1206 bytes --]

diff --git a/include/stdio.h b/include/stdio.h
index dca8acc..2227da6 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -10,7 +10,8 @@ extern "C" {
 #define __NEED_size_t
 
 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
+ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
+ !! defined(_BSD_SOURCE)
 #define __NEED_ssize_t
 #define __NEED_off_t
 #endif
@@ -120,7 +121,8 @@ char *tmpnam(char *);
 FILE *tmpfile(void);
 
 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
+ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
+ || defined(_BSD_SOURCE)
 FILE *fmemopen(void *, size_t, const char *);
 FILE *open_memstream(char **, size_t *);
 FILE *fdopen(int, const char *);
@@ -146,12 +148,13 @@ char *ctermid(char *);
 #endif
 
 
-#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
+#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
+ || defined(_BSD_SOURCE)
 #define P_tmpdir "/tmp"
 char *tempnam(const char *, const char *);
 #endif
 
-#if defined(_GNU_SOURCE)
+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
 #define L_cuserid 20
 char *cuserid(char *);
 #undef off64_t

  reply	other threads:[~2012-04-19 21:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-19 20:52 [0/3] _BSD_SOURCE patches: termios, ctype, stdio Isaac Dunham
2012-04-19 21:01 ` Isaac Dunham [this message]
2012-04-19 21:03 ` Isaac Dunham
2012-04-19 21:06 ` [3/3] _BSD_SOURCE for ctype.h Isaac Dunham

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=20120419140149.3ff93608@newbook \
    --to=idunham@lavabit.com \
    --cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).