Re: svn commit: r299456 - in head: include lib/libc/stdio

2016-05-12 Thread Conrad Meyer
On Thu, May 12, 2016 at 12:49 PM, Antoine Brodin  wrote:
> On Wed, May 11, 2016 at 4:38 PM, Conrad E. Meyer  wrote:
>> Author: cem
>> Date: Wed May 11 14:38:27 2016
>> New Revision: 299456
>> URL: https://svnweb.freebsd.org/changeset/base/299456
>>
>> Log:
>>   libc: Add fopencookie(3) wrapper around funopen(3)
>>
>>   Reviewed by:  jhb, oshogbo
>>   Sponsored by: EMC / Isilon Storage Division
>>   Differential Revision:https://reviews.freebsd.org/D6282
>
> Please revert this and request a ports exp-run as this breaks lots of
> important ports.

The number of failed ports is actually pretty small (less than 11).
I've identified a couple different kinds of issue and implemented
fixes for them.

1. libc doesn't actually export the fopencookie() function, because it
was missing from Symbols.map (base issue).  This is rectified in
299572 and I've personally test-built php56 successfully with that
change.

2. Some ports assume that off64_t's presence in stdio.h implies it is
more widely available (port issue).  Or that it implies __off64_t
exists.  Examples: devel/rudiments, devel/zziplib.  To that end, I've
made off64_t and __off64_t as widely available as off_t and __off_t in
r299571.  I've test-built both of these and both succeed after these
changes.

3. Finally, Clang (?)sometimes rejects that particular style of
function typedef (base issue).  Additionally, sometimes size_t isn't
defined.  For example, lang/pypy.  r299574 fixes that issue.  I've
personally test-built pypy (well, it's still compiling, but it's past
that initial platform detection failure now).

Are there any other important ports you think this change impacted?
Several other failures are not related to this change (Lynx, Xterm,
ncurses, cdialog).  So, other than assuming php70 and php55 will be
fixed by the same change as php56, I don't think there are any
failures unaccounted for that I haven't test-built successfully at
this point.

Do you still want a revert, or any further test builds?  Or is that fine?

Best,
Conrad
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r299456 - in head: include lib/libc/stdio

2016-05-12 Thread Antoine Brodin
On Wed, May 11, 2016 at 4:38 PM, Conrad E. Meyer  wrote:
> Author: cem
> Date: Wed May 11 14:38:27 2016
> New Revision: 299456
> URL: https://svnweb.freebsd.org/changeset/base/299456
>
> Log:
>   libc: Add fopencookie(3) wrapper around funopen(3)
>
>   Reviewed by:  jhb, oshogbo
>   Sponsored by: EMC / Isilon Storage Division
>   Differential Revision:https://reviews.freebsd.org/D6282

Hi,

Please revert this and request a ports exp-run as this breaks lots of
important ports.

Cheers,

Antoine (with hat: portmgr)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r299456 - in head: include lib/libc/stdio

2016-05-11 Thread Conrad E. Meyer
Author: cem
Date: Wed May 11 14:38:27 2016
New Revision: 299456
URL: https://svnweb.freebsd.org/changeset/base/299456

Log:
  libc: Add fopencookie(3) wrapper around funopen(3)
  
  Reviewed by:  jhb, oshogbo
  Sponsored by: EMC / Isilon Storage Division
  Differential Revision:https://reviews.freebsd.org/D6282

Added:
  head/lib/libc/stdio/fopencookie.3   (contents, props changed)
  head/lib/libc/stdio/fopencookie.c   (contents, props changed)
Modified:
  head/include/stdio.h
  head/lib/libc/stdio/Makefile.inc
  head/lib/libc/stdio/funopen.3

Modified: head/include/stdio.h
==
--- head/include/stdio.hWed May 11 14:37:33 2016(r299455)
+++ head/include/stdio.hWed May 11 14:38:27 2016(r299456)
@@ -58,6 +58,11 @@ typedef  __ssize_t   ssize_t;
 #endif
 #endif
 
+#ifndef _OFF64_T_DECLARED
+#define_OFF64_T_DECLARED
+typedef__off_t off64_t;
+#endif
+
 #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
 #ifndef _VA_LIST_DECLARED
 typedef__va_list   va_list;
@@ -427,6 +432,18 @@ FILE   *funopen(const void *,
 #definefropen(cookie, fn) funopen(cookie, fn, 0, 0, 0)
 #definefwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0)
 
+typedef ssize_t (cookie_read_function_t)(void *, char *, size_t);
+typedef ssize_t (cookie_write_function_t)(void *, const char *, size_t);
+typedef int (cookie_seek_function_t)(void *, off64_t *, int);
+typedef int (cookie_close_function_t)(void *);
+typedef struct {
+   cookie_read_function_t  *read;
+   cookie_write_function_t *write;
+   cookie_seek_function_t  *seek;
+   cookie_close_function_t *close;
+} cookie_io_functions_t;
+FILE   *fopencookie(void *, const char *, cookie_io_functions_t);
+
 /*
  * Portability hacks.  See .
  */

Modified: head/lib/libc/stdio/Makefile.inc
==
--- head/lib/libc/stdio/Makefile.incWed May 11 14:37:33 2016
(r299455)
+++ head/lib/libc/stdio/Makefile.incWed May 11 14:38:27 2016
(r299456)
@@ -8,7 +8,8 @@ SRCS+=  _flock_stub.c asprintf.c clrerr.c
fclose.c fcloseall.c fdopen.c \
feof.c ferror.c fflush.c fgetc.c fgetln.c fgetpos.c fgets.c fgetwc.c \
fgetwln.c fgetws.c \
-   fileno.c findfp.c flags.c fmemopen.c fopen.c fprintf.c fpurge.c \
+   fileno.c findfp.c flags.c fmemopen.c fopen.c \
+   fopencookie.c fprintf.c fpurge.c \
fputc.c fputs.c \
fputwc.c fputws.c fread.c freopen.c fscanf.c fseek.c fsetpos.c \
ftell.c funopen.c fvwrite.c fwalk.c fwide.c fwprintf.c fwscanf.c \
@@ -35,7 +36,7 @@ SYM_MAPS+=${LIBC_SRCTOP}/stdio/Symbol.m
 
 MAN+=  fclose.3 ferror.3 fflush.3 fgetln.3 fgets.3 fgetwln.3 fgetws.3 \
flockfile.3 \
-   fopen.3 fputs.3 \
+   fopen.3 fopencookie.3 fputs.3 \
fputws.3 fread.3 fseek.3 funopen.3 fwide.3 getc.3 \
getline.3 getwc.3 mktemp.3 open_memstream.3 \
printf.3 printf_l.3 putc.3 putwc.3 remove.3 scanf.3 scanf_l.3 setbuf.3 \

Added: head/lib/libc/stdio/fopencookie.3
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/stdio/fopencookie.3   Wed May 11 14:38:27 2016
(r299456)
@@ -0,0 +1,156 @@
+.\" Copyright (c) 2016, EMC / Isilon Storage Division
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
+.\" IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+.\" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+.\" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+.\" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+.\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+.\" OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd May 9, 2016
+.Dt FOPENCOOKIE 3
+.Os
+.Sh NAME
+.Nm fopencookie
+.Nd open a stream
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS