Страница Minux Manual для Futex (2) описывает интерпретацию четвертого аргумента следующим образом: < /p>
For several blocking operations, the timeout argument is a pointer
to a timespec structure that specifies a timeout for the
operation. However, notwithstanding the prototype shown above,
for some operations, the least significant four bytes of this
argument are instead used as an integer whose meaning is
determined by the operation. For these operations, the kernel
casts the timeout value first to unsigned long, then to uint32_t,
and in the remainder of this page, this argument is referred to as
val2 when interpreted in this fashion.
< /code>
< /blockquote>
Я предполагаю, что цель двух литков - просто получить нижние 32 бита указателя, но почему это нужно сделать с двумя катерами, а не одним?uint32_t x = (uint32_t) (unsigned long) p;
< /code>
и это? < /p>
uint32_t x = (uint32_t) p;
Подробнее здесь: https://stackoverflow.com/questions/796 ... a-uint32-t
Зачем отдавать указатель на безписанный длинный, а затем на UINT32_T? ⇐ Linux
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Преобразовать массив символов ASCII в длинный и длинный в массив символов
Anonymous » » в форуме JAVA - 0 Ответы
- 71 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Стоит ли вам отдавать предпочтение перегрузке специализации шаблонов функций?
Anonymous » » в форуме C++ - 0 Ответы
- 9 Просмотры
-
Последнее сообщение Anonymous
-