Skip to content

Adding definition for _SC_AVPHYS_PAGES #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from

Conversation

MedourMehdi
Copy link
Contributor

Related to Freemint kernel commit ea227c8

@mikrosk
Copy link
Member

mikrosk commented Jan 17, 2025

Hmm, maybe we should also update posix/sysconf.c? It's quite outdated (see _SC_LAST...) and maybe we should add at least something like Malloch(-1)/PAGE_SIZE there (and something similar for total memory size)

@MedourMehdi
Copy link
Contributor Author

MedourMehdi commented Jan 17, 2025

Yes I'm agree but doesn't it need to be part of an other commit?

I though that missing values ​​here are

    case _SC_CHILD_MAX:
      return CHILD_MAX; /* This is defined to 999 in mintlib but the actual call return UNLIMITED? */

    case _SC_NPROCESSORS_CONF:
      return __get_nprocs_conf (); /* Can check number of line in /kern/stat or just return 1 */

    case _SC_NPROCESSORS_ONLN:
      return __get_nprocs (); /* Can check number of line with CPU in /kern/stat or just return 1 */

    case _SC_PHYS_PAGES:
      return __get_phys_pages (); /* Using memtop and ramtop ? */

    case _SC_AVPHYS_PAGES:
      return __get_avphys_pages (); /*--> Don't really know if Malloc(-1) is ok. See https://www.atari-forum.com/viewtopic.php?p=470691#p470691  */

About SC_LAST I don't know where it comes from and what it does

@mikrosk
Copy link
Member

mikrosk commented Jan 17, 2025

_SC_LAST is, if I understand correctly, the last index of all handled values, like you updated in FreeMiNT.

The proposal with Malloch() was the first thing which came into my mind -- obviously, it's gonna be a hack anyway but we should return at least something so given software will not be working only in FreeMiNT.

And sure, a separate commit is fine.

@MedourMehdi
Copy link
Contributor Author

Yes I understand that too but it doesn't exist elsewhere (at least no trace in my google searches) and it's not used in mintlib so I was wondering if you'll have some clue about it.

Yes agreed better to give something than crashing :)

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