Страница 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
1748219673
Anonymous
Страница 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;
Подробнее здесь: [url]https://stackoverflow.com/questions/79638177/why-cast-a-pointer-to-an-unsigned-long-then-to-a-uint32-t[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия