darlinghq / darling

Darwin/macOS emulation layer for Linux

Home Page:http://www.darlinghq.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot build my gettimeofday() implementation compiled in and/or functioning

Informeli opened this issue · comments

Build Log
What is the build error?
It builds well, but my commit doesn't do anything

Put the build log here!

System Information
What system are you building with?
Debian stable AMD64

| Software | Version |
|darling master @ 7c8415e|
| Clang | 14.0.6 |
| CMake | 3.2.5 |
| Linux Kernel | X.Y.Z |
| Darling | Git Commit Hash |

`extern "C"
{
/Copyright(c) 2024
Martin Johan Smouter. All Rights reserved.
You can freely use and license this source code and the resulting binary under the gplv3+ license with usage of section 7 to enforce that people don't violate the licenses of the dependencies of this program.
/
/**

  • This file is part of Darling.
  • Copyright (C) 2024 Martin Johan Smouter
  • Darling is free software: you can redistribute it and/or modify
  • it under the terms of the GNU General Public License as published by
  • the Free Software Foundation, either version 3 of the License, or
  • (at your option) any later version.
  • Darling is distributed in the hope that it will be useful,
  • but WITHOUT ANY WARRANTY; without even the implied warranty of
  • MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  • GNU General Public License for more details.
  • You should have received a copy of the GNU General Public License
  • along with Darling. If not, see http://www.gnu.org/licenses/.
    /
    #include "libsystem_kernel.h"
    /here the bsd part begins/
    /
    $OpenBSD: select.h,v 1.17 2016/09/12 19:41:20 guenther Exp $ /
    /
    Copyright (c) 1992, 1993
    • The Regents of the University of California. All rights reserved.
    • @(#)select.h 8.2 (Berkeley) 1/4/94
      /
      /
      sys/time.h and sys/select.h are under the old bsd with advertisement clause license and I need them for timeval and timezone structs /
      #include <sys/select.h>
      /
      $OpenBSD: time.h,v 1.66 2023/10/17 00:04:02 cheloha Exp $ /
      /
      $NetBSD: time.h,v 1.18 1996/04/23 10:29:33 mycroft Exp $ /
      /
      Copyright (c) 1982, 1986, 1993
    • The Regents of the University of California. All rights reserved.
    • @(#)time.h 8.2 (Berkeley) 7/10/94
      /
      static struct timezone {
      int tz_minuteswest; /
      minutes west of Greenwich /
      int tz_dsttime; /
      type of dst correction */
      };
      /here the bsd part ends/
      /FIXME insert copyright acknowledgments in the object code(as required by the licenses)/
      /POSIX defined only undefined behavior could be problematic, but that only matters at system boot/
      /FIXME undefined behavior for gettimeofday if tv and tz are both NULL/
      int sys_gettimeofday(struct timeval *restrict tv, struct timezone *_Nullable restrict tz) {
      return LINUX_SYSCALL(__NR_96, tv, tz);
      }
      /if gettimeofday exists settimeofday also exists/
      int sys_settimeofday(struct timeval *restrict tv, struct timezone *_Nullable restrict tz) {
      return LINUX_SYSCALL(__NR_164, struct timeval *restrict tv, struct timezone *_Nullable restrict tz);
      }
      }`

Just discovered that the call didn't behave like it wasn't implemented, but wrongly implemented I will look again to the right call.