chiark / gitweb /
portability: Provide implementation of fmemopen
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 26 Nov 2019 22:16:22 +0000 (22:16 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 Feb 2020 21:56:49 +0000 (21:56 +0000)
commite4499269be39b8c72f7ec33ccfc6a8b5db7830d4
treee302d25c6f577d5832a4febf60e13afd18301d59
parent464d28f3278a0295e488449eb0b81bf199b78184
portability: Provide implementation of fmemopen

We are going to want one of these.  I have tested it as follows:

1. In configure.ac just before AC_CHECK_FUNCS, add:  LIBS+=-lbsd
2. In osdep.c, add:  #include <bsd/stdio.h>
3. Change all fmemopen to Yfmemopen, with
     git-ls-files | perl -lne 'print if lstat and -f _' | xargs perl -i~ -pe 's/fmemopen/Y$&/gi'

The result is that we do not find Yfmemopen.  The tests still pass and
I have verified that my stunt implementation is called.

FTR, this rune undoes the Y:
     git-ls-files | perl -lne 'print if lstat and -f _' | xargs perl -i~ -pe 's/Y(fmemopen)/$1/gi'

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
config.h.in
configure
configure.ac
osdep.c
osdep.h