### Summary

We have an ansible task using `wait_for` module to wait for network device carrier to be up:
```
wait_for:
  path: "/sys/class/net/{{ device }}/carrier"
  search_regex: "1"
  timeout: 60
```

This no longer works since https://github.com/ansible/ansible/commit/9d4ced1237380051334b54379ff64e45c0341a6d, because `mmap()` is now used instead of `read()`, and it isn't supported by `sysfs` in this case.

Do we really need to use `mmap()`? I imagine it might cause issues with other pseudofilesystems too.

In the meantime, we use a workaround: use grep in a loop instead
```
command:
  cmd: "grep 1 /sys/class/net/{{ device }}/carrier"
timeout: 1
retries: 60
register: carrier
until: carrier is successful
```

### Issue Type

Bug Report

### Component Name

wait_for

### Ansible Version

```console
$ ansible --version
ansible [core 2.13.7]
  config file = None
  configured module search path = ['/Users/rob.muir/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/rob.muir/workspace/trash/build/.env/lib/python3.10/site-packages/ansible
  ansible collection location = /Users/rob.muir/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/rob.muir/workspace/trash/build/.env/bin/ansible
  python version = 3.10.7 (main, Sep 15 2022, 01:50:27) [Clang 12.0.0 (clang-1200.0.32.29)]
  jinja version = 3.0.3
  libyaml = False
```


### Configuration

```console
# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
```


### OS / Environment

Mac OS controller, Centos Stream 9 target

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```
# set device to say, eth0 or whatever is on your computer
wait_for:
  path: "/sys/class/net/{{ device }}/carrier"
  search_regex: "1"
  timeout: 60
```


### Expected Results

Expect wait_for to still work with files in /sys

### Actual Results

```console
The wait_for will fail, only with recent ansible versions, due to the use of mmap()
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
time.sleep(module.params['sleep'])
        else:
            elapsed = utcnow() - start
            if port:
                module.fail_json(msg=msg or "Timeout when waiting for %s:%s to stop." % (host, port), elapsed=elapsed.seconds)
            elif path:
                module.fail_json(msg=msg or "Timeout when waiting for %s to be absent." % (path), elapsed=elapsed.seconds)
    elif state in ['started', 'present']:
        
        end = start + datetime.timedelta(seconds=timeout)
        while utcnow() < end:
            if path:
                try:
                    os.stat(b_path)
                except OSError as e:
                    
                    if e.errno != 2:
                        elapsed = utcnow() - start
                        module.fail_json(msg=msg or "Failed to stat %s, %s" % (path, e.strerror), elapsed=elapsed.seconds)
                    
                else:
                    
                    if not b_compiled_search_re:
                        
                        break
                    try:
                        with open(b_path, 'rb') as f:
                            with contextlib.closing(mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)) as mm:
                                search = b_compiled_search_re.search(mm)
                                if search: