what happens in the kernel during malloc?

When user space applications call malloc(), that call isn’t implemented in the kernel. Instead, it’s a library call (implemented glibc or similar). The short version is that the malloc implementation in glibc either obtains memory from the brk()/sbrk() system call or anonymous memory via mmap(). This gives glibc a big contiguous (regarding virtual memory addresses) … Read more

Adding system header search path to Xcode

We have two options. Look at Preferences->Locations->”Custom Paths” in Xcode’s preference. A path added here will be a variable which you can add to “Header Search Paths” in project build settings as “$cppheaders”, if you saved the custom path with that name. https://help.apple.com/xcode/mac/11.4/#/deva52afe8a4 Set HEADER_SEARCH_PATHS parameter in build settings on project info. I added “${SRCROOT}” … Read more

Change system date programmatically

Here is where I found the answer.; I have reposted it here to improve clarity. Define this structure: [StructLayout(LayoutKind.Sequential)] public struct SYSTEMTIME { public short wYear; public short wMonth; public short wDayOfWeek; public short wDay; public short wHour; public short wMinute; public short wSecond; public short wMilliseconds; } Add the following extern method to your … Read more

What are the differences of system(), exec() and shell_exec() in PHP?

exec — Execute an external program system — Execute an external program and display the output shell_exec — Execute command via shell and return the complete output as a string so if you don’t need the output, I would go with exec. Further details: http://php.net/manual/en/function.exec.php http://php.net/manual/en/function.system.php http://php.net/shell_exec

How to set system wide umask?

Both Debian and Ubuntu ship with pam_umask. This allows you to configure umask in /etc/login.defs and have them apply system-wide, regardless of how a user logs in. To enable it, you may need to add a line to /etc/pam.d/common-session reading session optional pam_umask.so or it may already be enabled. Then edit /etc/login.defs and change the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)