Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (!_M_file)
- return 0.0;
- const int fd = fileno(static_cast<FILE*>(_M_file));
- if (fd < 0)
- return 0.0;
- int ent;
- if (ioctl(fd, RNDGETENTCNT, &ent) < 0)
- return 0.0;
- if (ent < 0)
- return 0.0;
- const int max = sizeof(result_type) * __CHAR_BIT__;
- if (ent > max)
- ent = max;
- return static_cast<double>(ent);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement