2024-03-16

Missing unix/linux/posix file open option

What I would like is a file open option for "create replacement file".

The idea is that this makes a new inode in the same mount point as the target filename, which has no actual directory entry, but on close it replaces the directory entry of the specified path with the new file.

Why?

There are many situations where you want to make a new file to replace an existing file, but want the change from old to new file to be atomic at the file system level.

Something reading the half written new file is bad.

So you make a new temporary file, and then finally use rename() to replace the original, but that is only atomic if you are on the same mount point. You cannot simply use a mktemp() in /tmp for that as the target file may not be on the same mount point as /tmp. So you make a file with a dot prefix and some suffix or something. Messy. And needs cleaning up if you crash.

Easy?

It really would not be hard, I am sure, for the underlying filing system to support this as a file open mode. The atomic replacement of the directory entry is already a thing in rename(), and the idea of a file not in a directory but using space while open is easy - make a file and unlink it before closing. So the underlying mechanisms for this exist.

The only caveat, as a really useful extra feature, would be if not a "clean" close() call, i.e. a close because code aborted or exited without calling close(), it would *not* replace the original, just lose the new file as not in a directory. This helps cover the crash case, and always cleans up inherently.

This would be so useful.

And, of course, make gcc use this for making binaries!!!

Just to be clear, I am not suggesting "buffering" the whole file. The system to have an open file not in a directory already exists. One can create a file and open it and unlink it and still write to it, on to "disk". That is the "buffering" here. Just atomically either lose the new file (if crash, as would happen if you did that) or replace the directory entry with it and lose the old file, on clean close() call.

You can nearly do it!

Thanks for all the feedback, it is close... open() explains a _GNU_SOURCE specific option O_TMPFILE. This allows you to create an unnamed file which will vanish when you close, even if you crash. It then explains you can use a slightly convoluted call to linkat() to name the file before you close it. This nearly does the job, but not quite.

  1. The open() call needs a directory so it knows file system. Annoyingly you cannot pass the filename you want and have it work out the directory. It has to be the directory, meaning you have to faff about getting the directory from the file name. Not a big faff, obviously.
  2. The linkat() call needs CAP_DAC_READ_SEARCH set. There is a convoluted way to using /proc/ otherwise. More faff. Also, given that there is a documented way around the limitation, why is it dependant on a capability in the first place?!
  3. The linkat() call expects the new filename not to exist.

This does allow a file to be atomically created as a complete file, with no temp files if you crash. But this last point is the show stopper as it means you have to unlink() first, leaving a small window where the file does not exist. That or you link to a temporary file name and use rename() which puts us almost back where we started, albeit with a smaller window for leaving a temp file behind.

The obvious fix would be a new flag to linkat() to allow replacing the new file. That or allow AT_EMPTY_PATH in renameat2().

2024-03-12

Separating waste

I was not sure of posting this as it makes us look bad, so sorry about this.

Over the last few, what, decades, domestic waste collection has changed. And mostly without us noticing!

It all started a long time ago, we used to have a "dustbin" and any number of black bags taken away by the council. They had a legal obligation to remove all domestic waste.

Then one day it was "green wheelie bin", and they provided one. There were sizes for different houses. At this time we had five kids, and, I think, a lodger. We made plenty of domestic waste. We got a big bin.

So it was wheelie bin and extra bags.

Then the council said they would not take extra bags - it was because the vehicles were all set up for wheelie bins now. It made it much more efficient. So I asked.. "If it is more efficient, how much can I expect to see a reduction on my council tax bill?", and I did not get a sensible answer. I asked how they know it is more efficient, with no helpful answer!

Anyway, they said they were not restricting the amount of waste we produce, but it was a limitation of the vehicles, so I suggested "fine, empty the wheelie bin, then put the extra bags in the empty bin, and empty that". It was a simple and practical solution, but for some reason they were not happy to do that, suggesting their "reason" for not doing it was not as they said.

The answer was simple.

We purchased another wheelie bin!

For some time, many years, this worked, even when we moved house. And many locals had an extra wheelie bin.

Then, one day, with a note saying the would now only collect one wheelie bin, they stole our extra wheelie bin! I meant to sue them for the cost.

I gave up!

This is very unlike me, but I decided to give up!

Just to be clear, I was not giving up on recycling or trying to avoid it. At the time the council only did the one type of collection - the general waste green wheelie bin. My issue is they stole one of our bins and refused to actually collect all the waste we produced.

So I simply engaged a commercial bin collection at the house.

I kept meaning to bill the council for this on the basis they had a legal obligation to collect all domestic waste, and were failing. I never got around to it.

When we moved, 3 years ago, we kept the commercial collection, simples. Why not?

Left out of the loop here

The problem is we have been left out of the loop here. For decades now we have simply put all rubbish in one bin, with black bags, and that was it, as we have for decades before.

Whilst others have gone through many changes of many coloured bins and bags and so on, we have not.

Turning over a new leaf...

As Wales have now made even commercial properties do waste separation, we have to get in to this, all of a sudden. This is a bit of a shock.

It does not look too hard, honest. Cans, bottles, card and paper, etc.

It seems laws have changed over the many years. We have not had to notice.

So yes, we are finally doing the domestic waste separation - thrown in the deep end. I am almost shocked you cannot just pay someone to do that for you - seems an obvious commercial opportunity.

It means a place in the house for the various bags, and bins, and containers. Finding what day they collect each. But I am sure we will manage.

Thanks to one of my daughter's for help with this.

Doing things right.

As someone says, I like to do things right, and we do have solar power generation we feed in to the grid and a green energy tariff and so on. I don't drive, and have not for decades. We had not actively tried to avoid waste separation, but to be honest I have not looked in to it either. It all kicked off with the council being arseholes and stealing our bin, and then it was a non issue as we got a commercial bin.

I am not entirely convinced the pushing responsibility on to individuals just going about their lives is the answer to climate issues, when so many big industries dwarf anything we can do, to be honest, but I do understand we do all need to take things seriously, and I already do quite a bit - just not this specific bit until now. Sorry. And I chose to post this to say sorry to some extent.

Update:

Wow, it is crazy, there seem to be no standards. I decided it would be a good idea to get some partitioned and/or stacked bins for the house. Make sense.

But the labelling and colours do not match what the council have. And the categories do not match. E.g. we have a green plastic tub for glass, but tins go in with plastic. Yet almost all bins you can by combined glass and tins in one bin, so would have misleading labelling, and nothing matches the colours.

2024-03-11

How not to QR (again)

I have mentioned a bit about QR codes before (here).

But today I saw an example of a QR done badly!

The QR code contains a reference, an alphanumeric code and number, and name of student. But the passcode is just the first part (8 character code).

So what is wrong here?

  1. The machine readable part, the QR code, has the redundant extra information of student name, why? QR has error check and correction code, so no need.
  2. People expect a QR code to be scannable, and for that to be anything useful it is best done as a URL. This is just text.
  3. The instructions ask you to go to a web site, and enter a pass code.

This could be so much better as a URL with a passcode on the end, perhaps as a query.

  1. The user could scan it, and even if it only went to the web site, that saves a lot of typing.
  2. The web site could use the query on the end to actually do the next step and save typing the passcode.
  3. If they need the QR for face to face stuff, collecting photos, whatever (which does not seem top be the case, so why even have the QR code at all on the paperwork), then scanning can easily skip the URL part and read the passcode part. Though the wording sounds like this may be printed first and scanned as part of taking photos - fine, scan with a URL in it, that does no harm.

And example of a case we have is serial numbers on FireBricks.

The QR code contains HTTPS://FB0.UK/900000050159 which serves two purposes. When scanned by a user it goes to the product page, but when scanned by my staff for a serial number on a delivery note or invoice, the HTTPS://FB0.UK/ is skipped by the system and the serial number correctly recorded.

2024-03-09

Except for access

Drivers should be aware what road signs mean. And so they need to be clear and unambiguous.

But some are a tad more challenging than others, and this is one example.

The "no motor vehicles" part, is easy. The issue is the "except for access". The signage site from which I nicked this image says "this sign grants permission for vehicles to pass but only for reasons of accessing premises or land adjacent to the road." Our version has Welsh as well :-)

That is not a bad description.

But it seems not quite 100% clear in some cases. It seems (and if someone can confirm this is correct, or not, do comment), that these signs relate to an order that the council may have made. That order may have subtly different wording. The problem is that the motorists seeing the sign is in no position to find the order (which may be on display in the bottom of a locked filing cabinet stuck in a disused lavatory with a sign on the door saying "Beware of the Leopard" in the basement of the council offices). So hopefully motorists can rely on something simple like "for reasons of accessing premises or land adjacent to the road."

The only reason this came up is because I live on a corner of two roads, a main road, and a side road. The side road (well, three connected roads/closes from it) are subject to such an order. And it seems, before we purchased the property, this all kicked off with local residents of these side roads, understandably, pissed off over people parking in their (!) road just to visit the station - because the station car park is too small and costs money. I do understand, really. What we need is better station parking at a reasonable price, or free. That would solve it.

But, for some reason that I do not know (I was not here), even though including the next three properties with an address on the main road, like mine, they did not include what is now my property in any of the discussions, or "mailing list". And being not on the mailing list means now I am "talking out of my arse", oddly enough. I have met some of these people, and face to face they seem nice enough, and I have done my bit for the local area and the road (repointing a wall, and refurbishing a sign). I want to be a part of the community. But those that know me know that I try to do thins "right".

So what is the issue?

Well, I investigated this some years ago, largely because the side road has a load of "resident permit parking only" signs (cheap plastic, stuck to lamp posts, in English only, big clue). They seemed suspect at least. I found there is no way to apply for a permit! Indeed, when some of my visitors parked on the side road they got harassed and stickers on their cars, which itself may be an offence.

The person from the council, discussing (what was then a temporary order) was quite confrontational. He was adamant that "access" to my property (on the corner) somehow did not count, as I needed a drive on the side road(s) covered by the order. Well, some of the properties "on the road" don't have driveways, so clearly that makes no sense and even the legislation revers to pedestrian access. The fact we also have access from another road also makes no sense, but he tried that (several other properties have various levels of access from other roads as well). But he was pretty adamant, and I go nowhere (apart from them moving the signs maybe 30cm or so, in order not to actually be on my property).

To be clear, we have a nice drive space (three cars), and rarely will a visitor not be able avail themselves of that, but if not, then parking in the side road makes sense, just like anyone else in the area - these are not people parking to use the station, after all. Parking on the main road, a major A road, is not a good idea.

It came up again recently following a facebook post, which wound me up enough to email the council at 2am, but I got someone way more sane, well, mostly.

The "order" is not too bad now. It has been finally made a permanent order. "No person shall cause any motor vehicle to proceed in any of the lengths of road shown coloured blue on Drawing Number 1823 attached to this order except for access to properties situated along those lengths of road.", which leads to the question of "situated along" - a wording that is not quite the same as "adjacent". Adjacent definitely covers my property, as I have a long wall on a border on the side road, but what is "situated along"?

The council stated it is a contravention if "a motorist accesses these roads with the intention of accessing a property or business without a direct vehicular or pedestrian access point from.." so that sort of means they consider "situated along" as "having a direct vehicular or pedestrian access point from". Is that the actual legal meaning? I have no clue.

Actually, that is really odd, they have to have the intention to access a property or business at all, and one not on the road. Surely they can have intention to access a property on the road and one not on the road? That wording is way more restrictive than the actual wording of the order. I think it is therefore wrong.

Should it be this hard?

My concern here is that it should not be so complicated! How the hell is a driver meant to know the exact wording of the order, know it says "situated along", know that accessing a property not on the road (as well as on the road) is prohibited, and what "situated along" means exactly. No, clearly that is insane!

Do I qualify?

Well, thankfully, even though my property is absolutely "adjacent" to the road, and has a nice long wall on the road in question, it has maybe 1.5m of non-wall which is clearly pedestrian access from the road in question, with a pedestrian dropped kerb even. So I am pretty sure that is the case.

This is a slight problem as I am not "in the club", and have no "permits" (more below). So my visitors may quite legally enter the side road, and park, to visit me, without showing a permit. Why they chose to exclude my property from the discussions is unknown to me.

Crossing the line.

One slight caveat on the email from the council was "The point at which the order begins is where the signs are installed". Well, this is 100% incorrect, but I wonder if he said this to try and exclude me. The signs are the end of my wall, and my "pedestrian access" is before the signs. To park and access my property on foot means walking back passed the signs.

I say it is 100% wrong, with confidence, as the order states the names of the roads, and even has a plan with "blue" marking the roads. It shows the order starts at the main road. It even shows the signs position. So my property absolutely has pedestrian access from the area covered by the order, if that is what "situated along" actually means, and not just "adjacent" to. Even if the order started at the sign, I would be properly "situated along" the named road by the definition given, but clearly the order "starts" several metres before at the edge of the main road.

Why is this all stupid?

This is all silly, and the reason is that the clear stated intention is to restrict parking. The order says that is why it is made. It is what the locals want. It make sense. But this is not a parking restriction!

One issue is that the legislation allowing the council to even make a "no motor vehicles" order lists why they can do that, and parking restriction is not one. I raised this with the previous (unhelpful) contact and the best he could do was "maintain the character of the area". I pointed out the character of the area was "lots of cars parked with people using the station" and he was "improving" (i.e. not "maintaining") the character. The response seems to be the order saying: "If any person wishes to question the validity of the Order or any of its provisions on the ground that it or they are not within the powers conferred by the Act, or that any requirement of the Act or of any instrument made under the Act has not been complied with, that person may, within six weeks from the effect of the order 2a June 2023, apply for that purpose to the High Court." which seems odd, as I would expect if the order is invalid, it is invalid without time limit, and someone could challenge it as invalid in defence of a penalty charge / conviction for the driving offence. I may be wrong.

Surely the answer would be to actually make a proper parking restriction?!

Even if the order is valid, then what?

If the order is valid, then what? Well, it seems to be a moving traffic offence enforced by the police, so that seems to me to mean the police have to see (or maybe CCTV) a vehicle crossing the signs, and then what? Follow the driver and all passengers to see if any of them access a property? The rules allow for "intend" to access a property so someone could aim to visit someone, park, call, and find the are out, and leave, and be legal. Someone could visit and park on the basis that it is close to a property they will visit when the return from going to Newport on the train - again intention to access a property "situated along" the road even if police officer follows them to the station. And then what is access, well, anyone actually intending to circumvent these rules just needs a few Chinese menus, and record themselves dropping one in a letter box on each visit as they walk to the station. They have "accessed" a property in the area covered by the order in doing so, and having done so there is no parking restriction to stop them parking for as long as they like.

So, in essence, enforcing this is almost impossible. My understanding is that these orders are usually for "rat runs" when someone drives in one end of a road and out of the other end - which is easy to enforce. Trying to enforce this use "as a parking restriction" has to be almost impossible.

So the best they can do is infer someone parked may have not planned to visit someone, because they have no permit. If all of the residents ensure all visitors show a permit, then maybe that can be inferred (apart from the Chinese menu trick). Apparently the whole permit scheme has been agreed with residents (not me) and council and mayor and police, so facebook says. But we have not been included, so our visitors will have no permit, so just as well no permit scheme exists legally.

But it gets worse, there is a small single track road leading in to the same area that has no signs, so even if someone was parked, and did not show a permit, and just parked to go to the station, they just have to say they came in that way, no passing signs and so no moving traffic offence.

The fix?

Scrap this stupidity, which is questionably legal anyway, and leaves so many loopholes, and actually do a proper parking restriction, or better still have free and available parking for the station so nobody needs to park in these side roads!

If it was actually permit parking, we would apply for a couple of permits just in case.

I want to be part of the community here, and any help I can offer in making this right and workable, I am happy to offer. I do have a property "on" the road in question. But telling me I am "talking out of my arse" on facebook is not the way to progress matters, is it?

We'll see how it goes.

Or this :-)

THINK!

This was the scene I saw, walking from my house last night.

The reason is that there are some over night closure of one side of the road (behind me in that view), so one way and traffic lights, for resurfacing (something we all want done).

So what's the problem? Interestingly, posting this on mastodon, there was almost entirely very understanding response (contrary to the arguments that would have instantly ensued on 𝕏, and why I avoid it). Indeed, some pointed out they would ask the council to move the obstruction to the footpath, or take in to their own hands (not ideal). But is there a problem and what is the solution.

My main issue here is that those placing the signs probably did not think for one second about what they were doing. They presume that (a) they cannot possibly inconvenience drivers by putting the signs on the road itself, and (b) that this would be no inconvenience to pedestrians or that pedestrians simply don't matter somehow. It is also very common when there is a cycle lane for signs to appear in the cycle lane, totally blocking its normal use.

What is weird here is that these signs are to announce a serious inconvenience to motorists - a blocked lane and traffic lights, so considering not inconveniencing them with signs in the road seems a tad odd even. It's a 20mph road, with good street lighting, so not like they need lots of advance warning.

For pedestrians, many of us can walk around them, but a lot harder for wheelchair users, or blind, and so on. Not a single thought given to them.

Is there a solution? Well the main thing is consider all road users. It may be that the signs could have been placed in the gutter and partly on the pavement leaving space for both cars, and pedestrians (even in a wheelchair) to pass with minimal inconvenience. It would depend on the road/pavement in question, but this pavement may be wide enough. When not the case, well, these signs are not related to pedestrian use, so simply put them in the road, surely?

But whatever, someone putting up signs needs to actually think - simple as that!

2024-03-05

One can dream

It is nice to dream, and daydream even. Is it a "daydream" when lying in bed, not actually asleep, but just coming up with daft ideas to ponder while you fall asleep? You all do that right? Anyway, I am sure many have done exactly the same in thinking of crazy things for the hell of it, like "what if I could fly?", "what if I could teleport?", and perhaps even "what if I was a god?".

The "what if I was a god?" one is entertaining to ponder, like, I suddenly find I can do anything, (maybe I crack the back door in the simulation) - do I keep quiet and do things in small ways for fun, or what. Of course the obvious thing to do, (well, apart from just fix the climate, just fix poverty, etc), but especially with the state of world, is to smite the hell out of of some of the political figures and world leaders that are being dicks in my humble opinion. Zap them with lightning, Thor style, or make them disappear, or if you want to be subtle, just make them ill. One idea in such a daydream, was send them to hell for 1000 years and then bring them back with no time passed. Proper smiting stuff. One can dream!

But when exploring the idea you quickly realise smiting, and punishment don't make sense. If they are being dicks, just change them, use your omnipotence to just make them "nice". Problem solved.

Indeed, the whole concept of punishment, and hence also reward, and even rules, and tests, all make no sense for an omnipotent god. Would such ideas even occur to a god? They sort of make sense to a parent trying to adjust the behaviour of a child, but only because parent can't simple change the behaviour of the child directly. A god has no reason to consider the concept of punishment or reward.

If a god wants to make its beings, for whatever game it is playing, it can make them "play nice" in the first place. Or the second place, if first time it realises its beings turn out to be dicks, but obviously a god would have known that was going to happen, so let's stick to "in the first place".

This is not really a "free will" thing, either. Maybe a god wants its beings to have free well to see how things go, fair enough, it is adding a roll of the dice to the game. But free will is always limited. I have free will - I can do any spontaneous shit I like, even if silly or stupid, but my free will can never make me poke a red hot poker in my eye. My free will has limits. So if a god wants some simple "play nice" rules, like the whole "not killing other people" one, which seems sane, then just make its beings have a natural aversion to the whole idea of killing people, just like the "poker in the eye" thing. Then they can still have lots of free will but within some sensible constraints. No need to even tell them the rules, or write them down, and certainly no need to punish them or reward them in any way.

It makes you wonder why gods in many religious texts include concepts of punishment, reward, tests, and rules, when an omnipotent deity would not even have to consider such concepts in the first place.

I'm not the first to ponder this by any means, I am sure. This will have some famous person's name on it, from 1000 years ago, won't it?

2024-03-04

2038

This may be slightly topical now as we have seen a seriously surprising number of leap year issues this year, or so it seems. See https://codeofmatt.com/list-of-2024-leap-day-bugs/

It is quite amazing how any programmer gets something as simple as leap years wrong. There was some excuse in 2000 maybe as people had the vague idea that every 100 years there is no leap year, but 2000 was an exception to that (every 400 years), so for the last 123 or so years we have had a leap year every 4 years. It is pretty damn simple. Personally, a much bigger issue is coding for clock changes twice a year, but leap years are simple, and there are a lot of libraries for it, so what the heck?!

Y2K was a joke?!

One of the other things I hear is people saying all the concern over Y2K bugs was just a waste of time as basically nothing happened, which is true for most people for most things. To be honest I think I heard of fewer Y2K issues than I did for this leap year, but memory can be like that.

In fact Y2K was only a non event simply because a lot of people (I was one of them) did a lot of work (OK I did not do a lot) to make sure it was a non event. There were a lot of things that would have gone wrong, honest.

Y2K was a huge success for proactive work to avoid a problem.

Y2K was easy?

One view is Y2K was not that hard to sort, the hard work was the sheer scale of it. It was almost entirely down to the way a year was recording as text or presented or input.

The classic example is your bank card that has the year as two digits. This is basically how many Y2K issues manifested.

Decades ago, checking an expiry year was easy, is current year (two digits) smaller/equal to year on card (two digits) - if so, OK.

The problem is when the current year is 97 and the year on the card is 02 as 02 is less than 97.

  • The real fix is to make years 4 digits (leaving us with a Y10K bug), but even with sticking to 2 digits, which was simpler for many things, there are issues to address...
  • One trick is if current year is >=50 and card expiry is <=50, add 100 to card expiry and compare. Simples! and solves Y2K. This is simple but broken, as what happens when it is 2051 and a card has an expiry of 49? That assumes 2149 expiry and so allowed. There are a few variations on this, and not always 50 as the reference.
  • A better way is if it seems expired by more than 50 years then assume not expired, that is a sliding comparison (several ways to do it), and for cards that only last a few years it is by far the best as you expect a card number to be replaced (or the whole concept of cards to have gone) long before a 50 year old card pops up.

The fact there is more than one way to do this is an issue, and a time bomb waiting to happen. I bet some people did the simple way and will find issues around 2050 ±5 years for all sorts of things, oops.

2038 is hard

This is where I have to explain time_t to you, sorry.

Unix, and many other systems from that, use a type for time that is seconds since the start of 1970. It is a simple system. Those seconds were stored in a signed 32 bit number, which allows -2147483648 to +2147483647 and hence dates from Fri 13 Dec 19:45:52 GMT 1901 to Tue 19 Jan 02:14:07 GMT 2038. This seemed a pretty good range. especially for adult engineers living in the early 70s. But 2038 is getting closer and closer. I may (hopefully) live to see it.

One of the Y2K issues is that the conversion of time_t to struct tm creates a tm_year that starts 1900, so would often be printed as 19%02d and so you would see 19100 for 2000. The fix is to change it to print %d and tm_year+1900. The whole struct tm thing is messy as hell and should have set tm_year to be the year, but even tm_mon is one out, so always fun!

So what's the fix?

  • A bodge, used on some systems, is to make time_t an unsigned 32 bit number. This allows time from 1970 to Sun 7 Feb 05:28:15 GMT 2106 but not dates before 1970, which is good enough™.
  • The proper way is to change time_t to a signed 64 bit type. This is what unix/posix has done. This allows times from invalid date to out of range date... OK roughly ±292 billion years from now, which is pretty good given the universe started only around 13.7 billion years ago. But it may well continue more than 292 billion years, so we may have a Y292B bug coming up. Be ready!

So it should be simple, change time_t, right?

What's the problem?

The problem here is not that the fix is harder, it is indeed simple, change time_t to 64 bit, but that it is harder to find the problems. Y2K was a lot about input/output a year as 2 digits. It was way more visible. 2038 is harder as it is hidden. It also happens in a lot of embedded systems - the code that runs your fridge or your toaster, and much more.

For a start, any code properly using time_t will simply work if the underlying build environment and include files and libraries are all up to date to have a 64 bit time_t, and crucially the code uses all the time/date libraries. This is good, but also bad, as the code you are looking at is unchanged, working and not working code looks exactly the same!

The problem is that you need to know that the built binary image in some system was built in an environment that used 64 bit time_t. Do you know that for sure? How do your tell? How do you test?

There are also cases where code may happen to misuse an int or int32_t for something. You may have a proper 64 bit time_t passed to something that does maths using int, and then passes to something using a time_t as an answer. This will work for now, but not after 2038. This is hard to spot, and worse because int is a nightmare type it could be 16, 32, or 64 bits anyway, so may or may not work. It may work in some tests and not others!

And mostly I am talking of C code or things based on it, but many languages have time logic, and many are based on the time_t 32 bit time. Some will be easier and some harder to find the problem.

A fix to make something 64 bit time_t may also break things if that is communicated in binary in a protocol of a file. Is the other side expecting 4 or 8 bytes? So fixing this can break things in itself. This will be bugs long before 2038 in attempts to get ready for 2038.

For these reason 2038 may be way worse and way harder to track down and fix.

2036

There is actually another problem with NTP protocol which used 64 bit time, 32 bits for seconds from 1900, which expires in 2036. NTP changed to 128 bits some time ago, but some may get it wrong. It will be a bit of a dry run for 2038 issues. I hope I live to see this too, at the very least.

Anecdotes

As so many people now have no clue what Y2K was like, and may not have even been born, I say as an old fogy, one of the fun things coming up to Y2K was the bullshit.

We had customers and suppliers wanting us to make formal legal statements on "Y2K compliance".

We never signed any formal statement of "Y2K compliance", ever. We said we expect anything we controlled to work with any date, and if it failed we would work to fix it, like any other fault, and we expect the same of suppliers of things we sell.

One special case was Barclays card services, as they wanted us to confirm we were "Y2K compliant". I replied asking "compliant with what?".

I found that British Standards had created a standard for what Y2K compliance meant, and it covered working correctly with all dates before, on, and after 2000, which is way more than most people were doing. It meant that "Y2K compliance" to the BS meant 2036 and 2038 compliant!

We stated we were not as we were sure we had some systems that would fail in 2036, 2038, or 2106, or 10000. We also did not work with dates before 1582. So we could not say we complied with the British Standard on Y2K, and seriously, no company could! But we asked what standard they wanted us to comply with? Is it the BS standard or something else?

Importantly we asked if THEY were compliant with the same standard! We knew they were not.

They did not reply but later came back with new questions clearly to all customers, referencing the BS standard, and some clues on what they would do and comply with (even if not the BS standard). We did not claim to comply, as we could not, obviously, and there was no come back.

Nobody really pushed back on us saying we could, of course, not comply with Y2K compliance, and neither could anyone else, but we would try our best. Asking what the person asking the question was doing to comply was always telling. It was layers of bullshit on bullshit, and in some ways "fun". I wonder how may companies spent a lot of time on the "paperwork" and not just on actually fixing things.

Thankfully all the bullshit had a deadline.

Deadline

At the end of the day, for a lot of things, and I say this an an old fogy, it is "will I be dead before this is an issue". This is, perhaps, the problem with any such code, ever. I'd love to be around for the Y292B bug.

Missing unix/linux/posix file open option

What I would like is a file open option for "create replacement file". The idea is that this makes a new inode in the same mount p...