Better HN
topnewbestaskshowjobs
Log inSign up

andreyv

248 karma · joined Jun 11, 2016 (10y ago) · 60 submissions

Submissions

comment 11mo ago · link · parent

Follow this forum: https://forum.sailfishos.org/c/announcements/17.

comment 1y ago · link · parent

Autoconf can use cache files [1], which can greatly speed up repeated configures. With cache, a test is run at most once.

[1] https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/a...

comment 1y ago · link · parent

Here is a non-zero null pointer: https://gcc.godbolt.org/z/Po5r5Pa36

comment 1y ago · link · parent

It creates a compound literal [1] of type array of int, and initializes the specified array positions using designated initializers [2] with the results of calls to puts().

Using designated initializers without the = symbol is an obsolete extension.

[1] https://gcc.gnu.org/onlinedocs/gcc/Compound-Literals.html [2] https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html

5.

CVE-2024-6409: OpenSSH: Possible remote code execution in privsep child(openwall.com ↗)

141 points · by andreyv · 2y ago · 56 comments

comment 2y ago · link · parent

Even the original version 1507 is still supported on the LTSC channel. Support for UTF-8 manifest was added only in version 1903.

comment 2y ago · link · parent

Old does not mean bad. Even a decade later Wayland struggles to provide basic features that were built in the X protocol.

comment 2y ago · link · parent

The number of registers available to the program is fixed in the instruction set. The program cannot address more registers without recompiling it to an extended instruction set.

comment 3y ago · link · parent

First person shooters. Vertical synchronization causes a noticeable output delay.

For example, with a 60 Hz display and vsync, game actions might be shown up to 16 ms later than without vsync, which is ages in FPS.

comment 3y ago · link · parent

The Soviet Union briefly tried 5 and 6 day weeks in the 1930s: https://en.wikipedia.org/wiki/Soviet_calendar

comment 3y ago · link · parent

You can use systemd-cron [1] to run traditional cron jobs with systemd. No need for a separate daemon anymore.

[1] https://github.com/systemd-cron/systemd-cron

comment 3y ago · link · parent

Instead of "/usr/bin/time" you can also write "command time".

comment 3y ago · link · parent

1% is still a lot for power saving. If the system is idle, it should be at 0%. If it is anything above, then it shows poor design.

comment 4y ago · link · parent

See: https://en.wikipedia.org/wiki/Lagrange_polynomial

comment 4y ago · link · parent

Right — ferror() does not set errno, and so perror() is not appropriate here. fprintf(stderr, ...) would be better.

comment 4y ago · link · parent

In C, and many other languages, the file stream error state is saved after each operation, so you can skip error checking on every output line and only do

  if (fflush(stdout) != 0 || ferror(stdout) != 0)
  {
    perror("stdout");
    return EXIT_FAILURE;
  }
at the end of the program. The same should be done for stderr as well.

In GNU programs you can use atexit(close_stdout) to do this automatically.

comment 4y ago · link · parent

Perhaps this: https://docs.microsoft.com/en-us/windows-hardware/design/dev...

> On occasion, the system stays in the active mode (with the screen off) for a longer interval of time. These longer active intervals occur for a variety of reasons, for example, processing incoming email or downloading critical Windows updates.

comment 4y ago · link · parent

> So there is no way to abort a bash script if something like <(sort nonexistent) fails.

The process ID of the last executed background command in Bash is available as $!.

  cat <(sort nonexistent)
  wait $! || echo fail
gives

  sort: cannot read: nonexistent: No such file or directory
  fail

19.

C++ iostreams: Unexpected but legal multithreaded behaviour(berthub.eu ↗)

2 points · by andreyv · 5y ago · discuss

comment 5y ago · link · parent

Dell also removed trackpoint and all touchpad buttons, and made up/down arrow keys half height on the new Latitude laptops.

These are not the changes one would expect to see in a professional-grade laptop. On the other hand, the Lenovo line looks good in this regard.

comment 5y ago · link · parent

Autoconf can use a cache file to speed up tests: https://www.gnu.org/software/autoconf/manual/autoconf-2.60/h...

comment 6y ago · link · parent

In fast-paced games it is essential to disable vertical synchronization as well, trading possible tearing for less input lag.

Does Wayland support this?

comment 7y ago · link · parent

C now has a memset_s() function to do this.

comment 7y ago · link · parent

Windows unredirects full-screen games, bypassing the compositing delay. This is also what sensible compositing X11 window managers do on Linux.

comment 7y ago · link · parent

Forced composition and vsync is a mistake for gaming.

The added output latency is unacceptable, especially for first-person shooters. A little tearing is nothing compared to the vsync lag.

If Wayland wants to replace X.org, then it should support also this use case. But full composition being mandatory isn't very encouraging in regard to this.

comment 7y ago · link · parent

Indeed, "volatile sig_atomic_t" is the recommended official C way to change a flag from a signal handler.

comment 7y ago · link · parent

There is no tearing with proper drivers and window managers. This was a problem in the past, but now is largely overstated.

comment 7y ago · link · parent

One counterargument is that for each ABI you need a different set of libraries loaded in memory.

So, if some programs in the system use the 64-bit ABI and some use x32, then memory usage may substantially increase. And, of course, this also affects CPU caches.

comment 8y ago · link · parent

What the actual hell.
12