[libc-commits] [PATCH] D157821: [libc] add fileno function for Linux

Alfred Persson Forsberg via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Aug 15 13:50:57 PDT 2023


alfredfo added a comment.

@sivachandra: Yes, I also wondered about that (re: "Linux implementation does not try to check if stream is actually a file stream"). I don't know what the best solution is. I tried both glibc and llvm-libc with invalid stream as argument and both crashed. Seems like musl libc also just assumes that the file ptr is valid https://elixir.bootlin.com/musl/latest/source/src/stdio/fileno.c#L7


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157821/new/

https://reviews.llvm.org/D157821



More information about the libc-commits mailing list