Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
[libc][GPU] ftell: use the LIBC_FTELL opcode instead of LIBC_FSEEK The GPU ftell() opened the RPC port with LIBC_FSEEK and only filled data[0]. The host server then called fseek(stream, data[1], data[2]) with whatever was left in the buffer from a previous message. glibc just returns EINVAL, so the bug is silent on Linux; the MSVC CRT treats an invalid 'origin' as an invalid parameter and terminates the process (0xC0000409, FAST_FAIL_INVALID_ARG). Still present in llvm-project main as of 2026-10. --- a/libc/src/stdio/gpu/ftell.cpp +++ b/libc/src/stdio/gpu/ftell.cpp @@ -16,7 +16,7 @@ LLVM_LIBC_FUNCTION(long, ftell, (::FILE * stream)) { long ret; - rpc::Client::Port port = rpc::client.open
(); + rpc::Client::Port port = rpc::client.open
(); port.send_and_recv( [=](rpc::Buffer *buffer, uint32_t) { buffer->data[0] = file::from_stream(stream);
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)