Commit Graph

367 Commits

Author SHA1 Message Date
Michael VAN CANNEYT
3d88722d8f * string -> shortstring 2023-07-14 17:26:10 +02:00
Michael VAN CANNEYT
8f6b6ccde5 * Char -> AnsiChar 2023-07-14 17:26:09 +02:00
florian
d4d4498fc0 * building on darwin (and most likely other BSDs) fixed 2023-01-21 21:19:24 +01:00
Jonas Maebe
1f328cf362 Darwin: use recent versions of stat(fs) records when available
When the RTL is built for Mac OS X 10.6 or newer, use the new versions
and the corresponding alternate system library functions.

Also extracted the Darwin stat record definition to reduce the
ifdef hell.
2022-07-06 22:25:05 +02:00
marcoonthegit
e384e36e84 * restore old behaviour for non freebsd for _syscall 2022-06-19 17:06:51 +02:00
marcoonthegit
adf1a0642f * add parameter (=0) to getdirentries, hopefully fixes occasional EFAULT loops.
probably the random value of the register caused problems, already in the patch from bug #37220
2022-06-19 15:21:42 +02:00
marcoonthegit
43010ed471 * commented statat for non freebsd, and fixed a typo. 2022-06-19 13:35:08 +02:00
marcoonthegit
99e3789fa3 * commit ACM's fpc.diff, resolves mantis #37220 and FreeBSD 12/13 syscall port 2022-06-18 13:58:00 +02:00
florian
7baf2461f0 * check paramstr argument for negative values, resolves #39410 2021-10-20 20:04:32 +02:00
Jonas Maebe
d8021a1102 + FreeBSD/AArch64 support (patch by Mikaël Urankar, mantis #38441)
git-svn-id: trunk@49157 -
2021-04-10 07:57:28 +00:00
Jonas Maebe
4166e8c464 * Darwin/BSD: fixed StackBottom calculation
git-svn-id: trunk@49139 -
2021-04-08 19:50:30 +00:00
ondrej
1a0ba60de6 * revert r47598: implement TRandomGenerator
git-svn-id: trunk@47605 -
2020-11-27 04:53:06 +00:00
ondrej
c4dd3b661a * rtl: implement TRandomGenerator for thread-safe random
git-svn-id: trunk@47598 -
2020-11-26 05:59:00 +00:00
pierre
51d6622148 Switch OpenBSD libc version of geterrnolocation from libcerrno lib C variable to _libc___errno function use
git-svn-id: trunk@47157 -
2020-10-23 10:25:44 +00:00
Tomas Hajny
288c7e3c9e * Do_IsDevice treats pipes and sockets the same way as character devices
git-svn-id: trunk@46863 -
2020-09-13 22:08:18 +00:00
florian
3cd4168ab3 + introduce TOSTimestamp
git-svn-id: trunk@44033 -
2020-01-25 14:14:41 +00:00
marco
edb07af423 * more GPL -> GPL with modification.
git-svn-id: trunk@43964 -
2020-01-17 15:01:23 +00:00
marco
3053f8c2e8 * many syscallh header files had GPL license instead of modified. I owned the copyright, or in one case, Thomas did, but it was a full copy of mine. -> changed to modified
* removed the remark about calling convention from several implementations. Oldfpccall no longer used.

git-svn-id: trunk@43962 -
2020-01-17 12:07:50 +00:00
Jonas Maebe
693e72ade3 * Darwin now uses Mach VM calls for memory allocation instead of mmap/munmap
+ added sysrealloc support for Darwin (Darwin does not have mremap)

git-svn-id: trunk@42729 -
2019-08-18 15:55:07 +00:00
svenbarth
90278f4859 + add fpmprotect function to complete fpmmap/fpmunmap
git-svn-id: trunk@42181 -
2019-06-06 20:46:01 +00:00
pierre
5fb61dc386 FreeBSD fixes for stat and dirent records
git-svn-id: trunk@41967 -
2019-05-01 15:59:52 +00:00
nickysn
d25e7b1074 * separated the OpenBSD version of the stat structure to a separate ifdef block.
* Fixed some incompatibilities in the OpenBSD stat structure - removed st_lspare
  and changed the type of st_blksize to cint32 instead of cuint32.

git-svn-id: trunk@41827 -
2019-04-04 15:55:16 +00:00
nickysn
122888741c + added some comments to the else/endif directives to make it easier to figure
out their corresponding ifdef

git-svn-id: trunk@41826 -
2019-04-04 14:52:28 +00:00
nickysn
46b98a6da4 * Improvements to the implementation of FpOpenDir for *BSD:
* use FpFStat instead of FpStat to avoid a race condition, where the directory
    path could change between the calls of FpOpen and FpStat
  * improved cleanup (i.e. call FpClose, free allocated memory to avoid
    memleaks) in case of errors

git-svn-id: trunk@41820 -
2019-04-02 17:44:23 +00:00
nickysn
aa3d13dd4a - removed the FPC_USE_GETDIRENTRIES_SYSCALL define and use_getdirentries_syscall
global variable, they are compatibility flags of a no longer supported OpenBSD version

git-svn-id: trunk@41790 -
2019-03-24 16:30:50 +00:00
nickysn
ede50a2c4f - get rid of the FPC_USE_GETDIRENTRIES_I49_SYSCALL define and the
use_openbsd_getdirentries_49 global variable - both are compatibility features
  for a no longer supported OpenBSD version

git-svn-id: trunk@41789 -
2019-03-24 16:12:30 +00:00
nickysn
9a18543324 * cleaned up most of the obsolete OpenBSD syscall numbers
git-svn-id: trunk@41783 -
2019-03-23 20:35:03 +00:00
nickysn
01669ebf70 * use the actual _haltproc procedure, defined in the startup code on OpenBSD
* fixed the x86_64 syscall invocation in the OpenBSD _haltproc

git-svn-id: trunk@41762 -
2019-03-21 18:16:23 +00:00
nickysn
7b00c732b8 * Adjust for OpenBSD struct changes in the 'dir' structure. Based on OpenBSD
ports patch patch-fpcsrc_rtl_bsd_ostypes_inc

git-svn-id: trunk@41643 -
2019-03-08 16:26:40 +00:00
nickysn
2564588bf7 * Adjust for OpenBSD struct changes in the 'dirent' structure. Based on OpenBSD
ports patch patch-fpcsrc_rtl_bsd_ostypes_inc

git-svn-id: trunk@41642 -
2019-03-08 16:22:53 +00:00
nickysn
c183b49125 * refactored the ifdefs around the dirent structure
git-svn-id: trunk@41641 -
2019-03-08 16:18:17 +00:00
nickysn
d9509a22ad * Adjust for OpenBSD struct changes in the 'stat' structure. Based on OpenBSD
ports patch patch-fpcsrc_rtl_bsd_ostypes_inc

git-svn-id: trunk@41640 -
2019-03-08 16:14:40 +00:00
marco
14b14f3bda * fixes sysctl also with 3.0.4 as starting compiler.
M    rtl/bsd/sysctl.pp
M    compiler/systems.pas

git-svn-id: trunk@38250 -
2018-02-16 17:58:20 +00:00
Károly Balogh
33abf859b4 netbsd/m68k: a fuggly fix for FpLseek, so the compiler works natively at least
git-svn-id: trunk@36803 -
2017-07-27 19:02:40 +00:00
Károly Balogh
12697deda7 netbsd: try to support syscalls which return 64bit values properly on 68k
git-svn-id: trunk@36802 -
2017-07-27 19:01:38 +00:00
Károly Balogh
90ed130750 bsd: add support for syscalls on m68k, based on NetBSD/elf
git-svn-id: trunk@36780 -
2017-07-23 23:02:44 +00:00
michael
52cd572cec * Use specific type for TFPSet elements
git-svn-id: trunk@36710 -
2017-07-09 14:47:27 +00:00
marco
324ec4af58 * another sysctl fix. Original fixes were done in the assumption that the
sysctl param type change was merged. It wasn't. So from specific 3.0 versions
   now all versions.

git-svn-id: trunk@36170 -
2017-05-10 09:09:59 +00:00
marco
818a64952c * fix bootstrapping issue on freebsd x86_64
git-svn-id: trunk@36162 -
2017-05-09 17:07:44 +00:00
michael
5bbf299c22 * Fix bug #31555, disbablefile locking
git-svn-id: trunk@35611 -
2017-03-17 07:58:59 +00:00
pierre
7853c23a0e Fix compilation after commit 35566: change sysctl name parameter type to pcint
git-svn-id: trunk@35573 -
2017-03-12 21:00:41 +00:00
marco
ec3aa1f56a * change sysctl name parameter type to pcint as per manpage. Param names already conform to manual page names, so not changed
mantis #31515

git-svn-id: trunk@35566 -
2017-03-11 16:23:02 +00:00
marco
46cd3181e4 * fix typo sysctlNAMEtomib, mantis #31515 by Heiko
git-svn-id: trunk@35548 -
2017-03-09 15:18:57 +00:00
Károly Balogh
5cde490e57 bsd: fixed the system unit to also include the softpu interface part on m68k, not only the implementation
git-svn-id: trunk@35312 -
2017-01-16 21:04:40 +00:00
marco
7ef8f00100 * more occured -> occurred spelling fixes.
git-svn-id: trunk@35130 -
2016-12-14 20:05:21 +00:00
Jonas Maebe
11c90a73b1 - removed "Set8087CW(Default8087CW)" call from SysEntry:
o it is already performed in fpc_cpucodeinit
   o in libraries, fpc_cpucodeinit first sets Default8087CW to the current x87
     control word to avoid them enabling fpu exceptions if the host platform
     had first disabled them

git-svn-id: trunk@33993 -
2016-06-15 18:32:07 +00:00
svenbarth
3f45860cf9 Use constref instead of const when passing TEntryInformation along
git-svn-id: trunk@33951 -
2016-06-11 20:45:47 +00:00
svenbarth
535621faaa Rename FPC_HAS_INDIRECT_MAIN_INFORMATION to FPC_HAS_INDIRECT_ENTRY_INFORMATION which is more logical considering the record's name
git-svn-id: trunk@33950 -
2016-06-11 20:38:22 +00:00
svenbarth
f406867100 Merged revision(s) 31929-31931,32547 from branches/svenbarth/packages:
Switch Mac OS X to indirect entry information.

compiler/systems/t_bsd.pas, TLinkerBSD:
  + implement InitSysInitUnitName
compiler/system.pas:
  * systems_internal_sysinit: add Darwin systems
compiler/hlcgobj.pas, thlcgobj:
  * gen_proc_symbol_end: for Darwin systems don't directly call PascalMain for libraries, but FPC_LIBMAIN instead
rtl/darwin:
  + add sysinit.pas unit which contains the executable and library entry points for Darwin
rtl/darwin/Makefile.fpc:
  * add sysinit unit
rtl/bsd/sysosh.inc:
  + add a Darwin specific TPlatformEntryInformation (could probably be used for all Unix systems...)
rtl/bsd/system.pp:
  * define FPC_HAS_INDIRECT_MAIN_INFORMATION for Darwin systems once we're no longer bootstrapping with 2.6.x
  + add EntryInformation variable (this could maybe moved to system.inc...)
  + add new procedure SysEntry that is called from the entrypoint and which sets up necessary information required by other parts of the RTL
  * the old FPC_SYSTEMMAIN is still in place for bootstrapping
rtl/inc/systemh.inc, TEntryInformation:
  * PascalMain is cdecl on non-Windows systems (ToDo: really?)
rtl/inc/system.inc:
  * initialstklen is provided by the indirect entry information, so no external here
........
Fix bootstrapping.

rtl/darwin/sysinit.pas:
  * enable the code only when no longer bootstrapping with 2.6.x
........
Fix bootstrapping.

rtl/objpas/objpas.pp:
  * define FPC_HAS_INDIRECT_MAIN_INFORMATION for Darwin only while not bootstrapping with 2.6.x
........
rtl/darwin/sysinit.pas:
  * reference PASCALMAIN correctly (I wonder how this even worked previously :/ )

git-svn-id: trunk@33949 -
2016-06-11 20:29:51 +00:00
marco
9c03d0d6ba * fix for mantis #25931 return error 5 on EBUSY and ENOTDIR
git-svn-id: trunk@33262 -
2016-03-17 21:14:07 +00:00