1 --- ./gen_uuid_c 2023-04-06 18:59:49.376261216 -0600
2 +++ ./gen_uuid.c 2023-04-06 17:57:00.987526837 -0600
4 for (i = 0; i < n; i+= ifreq_size(*ifrp) ) {
5 ifrp = (struct ifreq *)((char *) ifc.ifc_buf+i);
6 strncpy(ifr.ifr_name, ifrp->ifr_name, IFNAMSIZ);
8 +#if defined(SIOCGIFHWADDR) && !defined(__sun)
9 if (ioctl(sd, SIOCGIFHWADDR, &ifr) < 0)
11 a = (unsigned char *) &ifr.ifr_hwaddr.sa_data;
13 THREAD_LOCAL int state_fd = -2;
14 THREAD_LOCAL FILE *state_f;
15 THREAD_LOCAL uint16_t clock_seq;
23 +lock.l_whence = SEEK_SET;
28 save_umask = umask(0);
33 - while (flock(state_fd, LOCK_EX) < 0) {
34 + lock.l_type = F_WRLCK;
35 + while (fcntl(state_fd, F_SETLKW, &lock) < 0) {
36 if ((errno == EAGAIN) || (errno == EINTR))
43 - flock(state_fd, LOCK_UN);
44 + lock.l_type = F_UNLCK;
45 + fcntl(state_fd, F_SETLK, &lock);
48 *clock_high = clock_reg >> 32;