Fix stack initialization to correctness of passing argument tests #28
Reference in New Issue
Block a user
No description provided.
Delete Branch "user-programs-stdout"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fix stack initialization to pass stack addreses (rather than thread addresses) for the arguments and only pass name a single time
assigned to @gk1623
Lets extract
15to a constant (avoiding magic numbers)?Or perhaps at least
sizeof (file_name)to get the array size (since it's a direct array type)?Is this required?
Why are we keeping track of
argvat all, when during all the time that we use its value, it is equal toif_.esp?Agreed, Perhaps: FILE_NAME_LENGTH_MAX or FILE_NAME_MAX?
then yes in strlcpy I would also use sizeof.
I also agree with the comment to move the file naming to process_execute. So the other strlcpy line is to be moved there. Would still use sizeof though.
We must print the exit status as per the spec. But if you mean if it is required here, I agree with you that it is not, and should be instead left to
process_exit. See the other merge request.When I have a chance, I will also have a look at the process file, but maybe this will be after I am done with syscalls. So without reading the code, overall, try to extract logic into static functions, e.g., setting up the args, or lifting into the other functions when relevant.
sorry forgot that's now how
sizeofworks 😅 . I think I prefer just having the constant everywhere, wby?(otherwise we need to "assume" that char = byte, or have the rather ugly
sizeof (file_name) / sizeof (file_name[0]))Yeah that's very ugly. I think constant everywhere is the best approach too.
Pull request closed