MacOS doesn't support PRNG reseeding? While researching the topic of random number generation, especially practical aspects of using TRNG devices on different platforms, I found this code in MacOS kernel sources.

int
write_random(void* buffer, u_int numbytes)
{
#if 0
    int     retval = 0;
    prngContextp    pp;

    lck_mtx_lock(gPRNGMutex);

    pp = current_prng_context();

    if (ccdrbg_reseed(prng_infop(pp), pp-&gt;statep,
              bytesToInput, rdBuffer, 0, NULL) != 0)
        retval = EIO;

    lck_mtx_unlock(gPRNGMutex);
    return retval;
#else
#pragma  unused(buffer, numbytes)
    return 0;
#endif


Unless I'm wrong, this code snippet means that MacOS's random number generator cannot ever be manually reseeded by writing random data to /dev/random.

Is there some good reason for not allowing user-level reseeding in an operating system's random number generator?

Or maybe there are some other ways to do it? (Using securityd somehow?)
I can only guess at Apple's specific reason for this. But a good reason for not allowing user-level reseeding is explained in a post by D.J. Bernstein here.

Consider two secure sources of entropy $x, y$, and a malicious source $z$:


  
  Generate a random $r$.
  Try computing $H(x,y,r)$.
  If $H(x,y,r)$ doesn't start with bits 0000, go back to step 1.
  Output $r$ as $z$.
  


For some crypto applications (i.e. DSA and ECDSA), being able to consistently predict as few as 4 bits of randomness could lead to a complete break (in the case of (EC)DSA, the recovery of the secret key).

In this case, allowing user-level reseeding is precisely what could allow this kind of attack, since it would be the last source added.

Like he says, there doesn't appear to be a good reason to be adding new entropy to the PRNG all the time, since many cryptographic applications (e.g. EdDSA) show it is perfectly possible to deterministically expand 256 bits of quality randomness into an unending stream of secure randomness. Needing to add entropy just indicates your PRNG has been compromised at some point in the past and everything you've done since should be considered utterly broken. Instead, generating high quality entropy once and keeping it safe is a much better idea.

It seems Apple has taken that approach.