What does errno 139 (ETXTBSY) mean?

 
Could be also:
ConstantTypeOS
ERROR_SUBST_TO_SUBSTWin32 errorWindows
MBR_CHECKSUM_MISMATCHBugCheck CodeWindows
Previous Next
ETIMEDOUT EWOULDBLOCK

ETXTBSY

ETXTBSY is a UCRT POSIX compatibility constant with historical Unix file-execution semantics. It describes an attempt to obtain write access to an executable shared-text file while that file is being executed.

That is not the same model as a generic Windows file lock. Windows file access is governed by the sharing modes chosen when handles are opened, and the native failure must be interpreted through the return value and Windows error channel of the particular API. The presence of ETXTBSY in errno.h is therefore not evidence that a running Windows executable is the direct producer.

For a real write-access failure

  • Capture the file path, operation, desired access, requested share modes, and the handle-opening component.
  • Check whether an updater, antivirus scanner, loader, service, or another process holds incompatible access.
  • Use the native error value to distinguish sharing access, permissions, path, and file-system failures; do not reduce all of them to ETXTBSY.

On POSIX systems, ETXTBSY is tied to the executable shared-text rule. On Windows, diagnose the actual handle and sharing contract instead of applying Unix recovery advice blindly.

References


Looking for a different code? Search another status or error code.