| От | Tom Lane |
|---|---|
| Тема | Re: Allowing printf("%m") only where it actually works |
| Дата | |
| Msg-id | 2576.1527382833@sss.pgh.pa.us обсуждение |
| Ответ на | Re: Allowing printf("%m") only where it actually works (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-hackers |
I wrote: > ... It doesn't take much to make one nontrivial either. If > memory serves, malloc() can trash errno on some platforms such as macOS, > so even just a palloc creates a hazard of a hard-to-reproduce problem. After digging around in the archives, the closest thing that we seem to know for certain is that some versions of free() can trash errno, cf https://www.postgresql.org/message-id/flat/E1UcmpR-0004nn-2i%40wrigleys.postgresql.org as a result of possibly calling madvise() which might or might not succeed. But in the light of that knowledge, how much do you want to bet that malloc() can't change errno? And there's the possibility that a called function does both a palloc and a pfree ... regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера