1

Are there any standard bit manipulation routines/macros available, e.g. SETBIT, CLEARBIT-like. I found atomic bit operations in man -s9f atomic_bits, is there anything else?

Thanks.

Mark
  • 6,052
  • 8
  • 61
  • 129
  • Try Bit Twiddling: https://graphics.stanford.edu/~seander/bithacks.html – jim mcnamara Jul 29 '15 at 19:47
  • I'm aware of Bit Twiddling, but I thought there could be already something available in Solaris, so one doesn't need to re-invent the wheel. – Mark Jul 29 '15 at 20:21
  • 1
    Short answer - no. Solaris is an amalgam of previous flavors of UNIX, like BSD. This is evident by the /usr/ucb directory - name for the Univ of California Berkeley. You find whoami there for instance. The presumption was/is that most of the standard C stuff available in /usr/include would fly for almost any development. Any new stuff is up to you. Use bit hacks and create your own include files. – jim mcnamara Jul 30 '15 at 16:31
  • There are a few macros in sys/sysmacros.h – Liam Merwick Aug 10 '15 at 12:21
  • @Liam, those are useful macros, but I didn't find macros to set/clear specific bits. – Mark Aug 10 '15 at 13:32

0 Answers0