[vlc-devel] [PATCH 2/3] posix: add a replacement for strerror_l

Sean McGovern gseanmcg at gmail.com
Sun Sep 13 03:21:31 CEST 2015


On Sat, Sep 12, 2015 at 2:07 PM, Rémi Denis-Courmont <remi at remlab.net>
wrote:

> Le 2015-09-12 20:23, Sean McGovern a écrit :
>
>> This function is new for POSIX 2008.
>> See:
>>
>> https://www.gnu.org/software/gnulib/manual/html_node/strerror_005fl.html.
>> ---
>>  compat/strerror_l.c  |   37 +++++++++++++++++++++++++++++++++++++
>>  configure.ac         |    2 +-
>>  include/vlc_fixups.h |    5 +++++
>>  3 files changed, 43 insertions(+), 1 deletion(-)
>>  create mode 100644 compat/strerror_l.c
>>
>> diff --git a/compat/strerror_l.c b/compat/strerror_l.c
>> new file mode 100644
>> index 0000000..6ef7f63
>> --- /dev/null
>> +++ b/compat/strerror_l.c
>> @@ -0,0 +1,37 @@
>>
>>
>> +/*****************************************************************************
>> + * strerror_l.c: POSIX.1-2008 strerror_l replacement
>> +
>>
>>
>> *****************************************************************************
>>
>
> No copyrights?!
>
>
Am I permitted to credit it as 'the VideoLAN authors' similar to other
source files?


> + *
>> + * This program 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.
>> + *
>> + * This program 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 this program; if not, write to the Free Software
>> Foundation,
>> + * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
>> +
>>
>>
>> *****************************************************************************/
>> +
>> +#ifdef HAVE_CONFIG_H
>> +# include <config.h>
>> +#endif
>> +
>> +#include <errno.h>
>> +#include <locale.h>
>> +
>> +/* See:
>>
>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/strerror_l.html
>> */
>> +char *strerror_l(int errnum, locale_t locale)
>> +{
>> +#ifdef strerror_l
>>
>
> That does not make sense.
>
> +    return strerror_l(errnum, locale);
>> +#else
>> +    errno = ENOSYS;
>> +    return NULL;
>>
>
> This patch is for retarded OSes, and yet I doubt that all retarded OSes
> would have ENOSYS. (Not sure about <locale.h> either.)
>
>
>>
I really wish you would be more civil about this.

Can we make a list of operating systems that actually conform to
POSIX.1-2008? My suspicion is that there is only 1 -- Linux. Is this what
VLC 3.0.x will require conformance for? If so, I wonder what I am wasting
my time with.

My OS of choice, Solaris, definitely does not have strerror_l(). There has
been talk about including it for the next release of Illumos but at the
moment that is all it is -- talk.

FreeBSD does not have it.

OpenBSD does not either.

Windows doesn't count.

OS X doesn't have it either -- but this is irrelevant.

I'm not sure how much further I need to dig to show my point.

-- Sean McG.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20150912/4b86b055/attachment.html>


More information about the vlc-devel mailing list