I wanted a new thread for this.

Personally I think that I should submit a patch to the GNU patch people
but I have tried that in the past with the GNU Grub ( rev 2 ) people and
was flatly ignored.

Regardless there is probably an easy way to fix GNU patch so that it just
works as expected on all platforms everywhere and the patch would not be a
whole lot of work. The real work seems to be to submit a patch and have it
accepted by certain open source groups.

Then we package it up for Solaris users and move onto the next battle.

Dennis

---------------------------- Original Message ----------------------------
Subject: Re: [osol-code] [osol-discuss] open source apps on Solaris
OpenSolaris Nevada etc.
From:    "Joerg Schilling" <joerg.schill...@fokus.fraunhofer.de>
Date:    Sat, May 1, 2010 11:31
To:      rlha...@smart.net
         carls...@workingcode.com
Cc:      opensolaris-code@opensolaris.org
--------------------------------------------------------------------------

James Carlson <carls...@workingcode.com> wrote:

> On 5/1/10 2:01 AM, Richard L. Hamilton wrote:
> > I would very much like to see someone compare the OpenSolaris section 3*
> > man pages to The Open Group Base Specifications Issue 7 /
> > IEEE Std 1003.1???-2008
> > see what's what's missing, and get busy adding it.
>
> It sounds like this is your particular itch, so ...
>
> > I would even do some of the research and coding myself.  What I won't
> > do is spend a lot of time arguing about it and jumping through hoops.
>
> What arguing or hoops are you referring to?
>
> In general, trivial changes require trivial review.  Want to add
> strnlen() or something like that?  Cool.  It'll take a couple of short
> email messages, and you're done.
>
> In more detail: one short email message to describe the function (or

OK, let's see.... here is the code:

/* @(#)strnlen.c        1.1 10/04/26 Copyright 2010 J. Schilling */
/*
 *      strnlen() to be used if missing in libc
 *
 *      Copyright (c) 2010 J. Schilling
 */
/*
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * See the file CDDL.Schily.txt in this distribution for details.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file CDDL.Schily.txt from this distribution.
 */

#include <schily/standard.h>
#include <schily/unistd.h>
#include <schily/schily.h>

#ifndef HAVE_STRNLEN

EXPORT size_t
strnlen(s, len)
        register const char     *s;
        register size_t         len;
{
        register const char     *rs = s;

        if (++len == 0) {       /* unsigned overflow */
                while (len-- > 0 && *rs++ != '\0')
                        ;
                if (len == 0)
                        return (rs - s);
                return (--rs - s);
        } else {
                while (--len > 0 && *rs++ != '\0')
                        ;
                if (len == 0)
                        return (rs - s);
                return (--rs - s);
        }
}

#endif

Jörg


_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to