Solution: change return type to int (again) and return fd via an output parameter
Attach a file by drag & drop or click to upload