Skip to content

Conversation

@Sonicadvance1
Copy link
Member

FEX argument will no longer exist in /proc/<pid>/cmdline after this PR. Ensure this tool still works.

After #5097 is merged, one can use regular pidof for Linux applications, but this is still useful as it finds Wine applications running with FEX as well.

FEX argument will no longer exist in `/proc/<pid>/cmdline` after this
PR. Ensure this tool still works.

After FEX-Emu#5097 is merged, one can use regular `pidof` for Linux
applications, but this is still useful as it finds Wine applications
running with FEX as well.
@Sonicadvance1
Copy link
Member Author

Added support for FEXpidof FEX special case so that kill -9 $(FEXPidof FEX) still gives us equivalent behaviour as kill -9 $(pidof FEX).

@wcampbell-nv
Copy link
Contributor

but this is still useful as it finds Wine applications running with FEX as well.

I'm not sure this is necessary anymore, Wine similarly re-writes its argv[0] data so that /proc/pid/cmdline begins with the target .exe.

@Sonicadvance1
Copy link
Member Author

but this is still useful as it finds Wine applications running with FEX as well.

I'm not sure this is necessary anymore, Wine similarly re-writes its argv[0] data so that /proc/pid/cmdline begins with the target .exe.

hm. I was going to say that it still did a bit more than pidof, but actually because we rename cmdline away, we actually can't reliably detect wine anymore. It does still provide use for FEXpidof FEX but it'll miss Wine things.

ryanh@orion-o6:/mnt/Work/Work/work/FEXNew/Build_Radxa$ FEXpidof SonicMania.exe
ryanh@orion-o6:/mnt/Work/Work/work/FEXNew/Build_Radxa$ pidof SonicMania.exe
12373

I don't think there would be a good way to actually resolve this now.

@Sonicadvance1 Sonicadvance1 marked this pull request as draft December 5, 2025 23:44
@Sonicadvance1
Copy link
Member Author

I'll need to rethink how to determine if a process is FEX or not since it's tricky at this point.

@wcampbell-nv
Copy link
Contributor

/proc/pid/exe should always point to the original exe, maybe you can use that. readlink /proc/pid/exe outputs the original path.

@Sonicadvance1
Copy link
Member Author

Mostly just need to ensure it works in the three main modalities of FEX which will take a bit of time.

  • FEX - Running a linux app
  • FEX - Running x86 Wine and extracting the .exe out of it
  • Arm64ec/wow64 - Running inside of arm64 Wine and extracting the .exe file out of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants