tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: *oldlenp comes back with wrong value in helper sysctl_createv() function





         case CTLTYPE_STRING: {
                 unsigned char buf[1024], *tbuf;
                 tbuf = buf;
                 sz = sizeof(buf);
                 rc = prog_sysctl(&name[0], namelen, tbuf, &sz, NULL, 0);

The sysctl command first tries with a buffer of 1024 bytes
and retries with the right size when that was too small.

Got it, makes sense. Thanks for the reply!

--
------------------------------------------------------------------------
Emile `iMil' Heitor <imil@{home.imil.net,NetBSD.org}> | https://imil.net


Home | Main Index | Thread Index | Old Index